public class TCPSocketWrapper extends java.lang.Object implements SocketWrapper
| Constructor and Description |
|---|
TCPSocketWrapper(java.net.Socket socket,
boolean isJavaObjectExpected)
General constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
java.net.InetAddress |
getInetAddress()
This method returns the address of the socket that is bound to this socket.
|
boolean |
isClosed()
This method returns true if the socket has been closed.
|
java.lang.Object |
readObject()
This method reads the object from the socket.
|
java.lang.Object |
readObject(int numberOfSeconds)
This method reads an object from the socket.
|
void |
writeObject(java.lang.Object obj)
This method sends an object through the socket.
|
public TCPSocketWrapper(java.net.Socket socket,
boolean isJavaObjectExpected)
socket - a Socket instanceisJavaObjectExpected - a boolean.public java.lang.Object readObject()
throws java.lang.Exception
SocketWrapperreadObject in interface SocketWrapperjava.lang.Exceptionpublic java.lang.Object readObject(int numberOfSeconds)
throws java.lang.Exception
SocketWrapperreadObject in interface SocketWrappernumberOfSeconds - number of seconds to wait before throwing a TimeoutExceptionjava.lang.Exceptionpublic void writeObject(java.lang.Object obj)
throws java.io.IOException
SocketWrapperwriteObject in interface SocketWrapperobj - the object to be sent.java.io.IOExceptionpublic boolean isClosed()
SocketWrapperisClosed in interface SocketWrapperpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic java.net.InetAddress getInetAddress()
SocketWrappergetInetAddress in interface SocketWrapper