SocketImpl.h

Go to the documentation of this file.
00001 #ifndef JAVA_NET_SOCKETIMPL_H
00002 #define JAVA_NET_SOCKETIMPL_H 1
00003 
00004 #ifndef JAVA_NET_SOCKETOPTIONS_H
00005 #include <java_net/SocketOptions.h>
00006 #endif /* JAVA_NET_SOCKETOPTIONS_H */
00007 #ifndef JAVA_NET_INETADDRESS_H
00008 #include <java_net/InetAddress.h>
00009 #endif /* JAVA_NET_INETADDRESS_H */
00010 #ifndef JAVA_IO_FILEDESCRIPTOR_H
00011 #include <java_io/FileDescriptor.h>
00012 #endif /* JAVA_IO_FILEDESCRIPTOR_H */
00013 #ifndef JAVA_IO_INPUTSTREAM_H
00014 #include <java_io/InputStream.h>
00015 #endif /* JAVA_IO_INPUTSTREAM_H */
00016 #ifndef JAVA_IO_OUTPUTSTREAM_H
00017 #include <java_io/OutputStream.h>
00018 #endif /* JAVA_IO_OUTPUTSTREAM_H */
00019 #ifndef JAVA_NET_SPEC
00020 #include <java_net/Spec.h>
00021 #endif /* JAVA_NET_SPEC */
00022 
00023 namespace java {
00024   namespace net {
00025 
00026     using namespace java::io;
00027 
00040     class 
00041       SocketImpl : virtual public SocketOptions {
00042 
00043     public:
00044 
00053       virtual void create(jboolean stream) = 0;
00054   
00064       virtual void connect(const String& host, jint port, jint timeout = 0) = 0;
00065 
00075       virtual void connect(const Ref<InetAddress>& address, jint port, jint timeout = 0) = 0;
00076   
00084       virtual void bind(const Ref<InetAddress>& host, jint port) = 0;
00085 
00095       virtual void listen(jint backlog) = 0;
00096 
00104       virtual void accept(const Ref<SocketImpl>& s) = 0;
00105 
00113       virtual Ref<InputStream> getInputStream() = 0;
00114 
00122       virtual Ref<OutputStream> getOutputStream() = 0;
00123 
00133       virtual jint available() = 0;
00134 
00140       virtual void close() = 0;
00141 
00156       virtual void shutdownInput();
00157   
00173       virtual void shutdownOutput();
00174 
00181       virtual Ref<FileDescriptor> getFileDescriptor() const;
00182 
00189       virtual Ref<InetAddress> getInetAddress() const;
00190 
00197       virtual jint getPort() const;
00198 
00208       virtual jboolean supportsUrgentData() const;
00209 
00218       virtual void sendUrgentData(jint data) = 0;
00219 
00226       virtual Ref<InetAddress> getLocalAddress() const;
00227 
00234       virtual jint getLocalPort() const;
00235 
00242       jboolean isConnected() const;
00243 
00251       jboolean isBound() const;
00252 
00260       jboolean isClosed() const;
00261 
00269       jboolean isInputShutdown() const;
00270 
00278       jboolean isOutputShutdown() const;
00279  
00285       virtual String toString() const;
00286 
00287     protected:
00288 
00289       SocketImpl();
00290 
00294       Ref<FileDescriptor> fd;
00295 
00299       Ref<InetAddress> address;
00300 
00304       jint port;
00305 
00309       Ref<InetAddress> localAddress;
00310 
00314       jint localPort;
00315 
00319       jboolean bound;
00320       jboolean connected;
00321       jboolean shutIn;
00322       jboolean shutOut;
00323 
00324     private:
00325 
00326       REGISTER_MEMBERS;
00327 
00328     };
00329 
00330   } // namespace net
00331 } // namespace java
00332 
00333 #endif /* JAVA_NET_SOCKETIMPL_H */

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