ServerSocket.h

Go to the documentation of this file.
00001 #ifndef JAVA_NET_SERVERSOCKET_H
00002 #define JAVA_NET_SERVERSOCKET_H 1
00003 
00004 #ifndef JAVA_NET_SOCKETIMPL_H
00005 #include <java_net/SocketImpl.h>
00006 #endif /* JAVA_NET_SOCKETIMPL_H */
00007 #ifndef JAVA_NET_SOCKETIMPLFACTORY_H
00008 #include <java_net/SocketImplFactory.h>
00009 #endif /* JAVA_NET_SOCKETIMPLFACTORY_H */
00010 #ifndef JAVA_NET_SOCKET_H
00011 #include <java_net/Socket.h>
00012 #endif /* JAVA_NET_SOCKET_H */
00013 #ifndef JAVA_NET_SPEC
00014 #include <java_net/Spec.h>
00015 #endif /* JAVA_NET_SPEC */
00016 
00017 namespace java {
00018   namespace net {
00019 
00038     class JAVA_NET_SPEC ServerSocket : virtual public Object {
00039 
00040     public:
00041 
00064       static void setSocketImplFactory(const Ref<SocketImplFactory>& fac);
00065 
00072       ServerSocket();
00073 
00107       ServerSocket(jint port, jint backlog = 50, const Ref<InetAddress>& bindAddress = 0);
00108 
00115       virtual jboolean isBound() const;
00116 
00123       virtual jboolean isClosed() const;
00124 
00146       virtual void bind(const Ref<SocketAddress>& endpoint, jint backlog = 50);
00147 
00154       virtual Ref<InetAddress> getInetAddress() const;
00155   
00162       virtual jint getLocalPort() const;
00163 
00175       virtual Ref<SocketAddress> getLocalSocketAddress() const;
00176 
00204       virtual Ref<Socket> accept();
00205 
00219       virtual void close();
00220 
00237       virtual void setSoTimeout(jint timeout);
00238 
00247       virtual jint getSoTimeout() const;
00248 
00285       virtual void setReuseAddress(jboolean on);
00286 
00296       virtual jboolean getReuseAddress() const;
00297 
00333       virtual void setReceiveBufferSize(jint size);
00334 
00348       virtual jint getReceiveBufferSize() const;
00349 
00356       virtual String toString() const;
00357 
00358     protected:
00359 
00364       virtual void setImpl();
00365 
00366     private:
00367 
00371       Ref<SocketImpl> impl;
00372 
00376       static Ref<SocketImplFactory> factory;
00377 
00378       REGISTER_MEMBERS;
00379 
00380     };
00381 
00382   } // namespace net
00383 } // namespace java
00384 
00385 #endif /* JAVA_NET_SERVERSOCKET_H */

Generated on Fri May 16 11:54:43 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3