|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SocketConnectionFacade
The SocketConnectionFacade provides read and write operation for
communication over TCP/IP sockets.
It hides the details of the underlying I/O system used for socket
communication.
Method Summary | |
---|---|
void |
close()
Closes the socket connection including its input and output stream and frees all associated ressources. When calling close() any Thread currently blocked by a call to readLine() will be unblocked and receive an IOException. |
void |
flush()
Flushes the socket connection, that is sends any buffered but yet unsent data. |
java.net.InetAddress |
getLocalAddress()
Returns the local address this socket connection. |
int |
getLocalPort()
Returns the local port of this socket connection. |
java.net.InetAddress |
getRemoteAddress()
Returns the remote address of this socket connection. |
int |
getRemotePort()
Returns the remote port of this socket connection. |
boolean |
isConnected()
Returns the connection state of the socket. |
java.lang.String |
readLine()
Reads a line of text from the socket connection. |
void |
write(java.lang.String s)
Sends a given String to the socket connection. |
Method Detail |
---|
java.lang.String readLine() throws java.io.IOException
java.io.IOException
- if the connection has been closed.void write(java.lang.String s) throws java.io.IOException
s
- the String to send.
java.io.IOException
- if the String cannot be sent, maybe because the
connection has already been closed.void flush() throws java.io.IOException
java.io.IOException
- if the connection cannot be flushed.void close() throws java.io.IOException
java.io.IOException
- if the socket connection cannot be closed.boolean isConnected()
true
if the socket successfuly connected to a
serverjava.net.InetAddress getLocalAddress()
int getLocalPort()
java.net.InetAddress getRemoteAddress()
int getRemotePort()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |