|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.util.ExceptionIgnorer
org.pf.net.SocketConnection
org.pf.net.TextSocketConnection
public class TextSocketConnection
A connection based on a opened socket. The connection provides convenient methods to read and write lines from/to the underlying socket.
| Constructor Summary | |
|---|---|
TextSocketConnection(java.net.Socket openSocket)
Initialize the new instance to work on the given socket. |
|
TextSocketConnection(java.net.Socket openSocket,
ExceptionHandler exHandler)
Initialize the new instance to work on the given socket and use the specified exception handler to report exceptions to. |
|
| Method Summary | |
|---|---|
void |
close()
Close the connection and all release underlying resources. |
java.lang.String |
readLine()
Reads the next line from the socket's input stream and returns it. |
boolean |
write(java.lang.String text)
Writes the given text to the socket's output stream. |
boolean |
writeLine(java.lang.String line)
Writes the given string to the socket's output stream and appends a newline character. |
| Methods inherited from class org.pf.net.SocketConnection |
|---|
isClosed, isOpen |
| Methods inherited from class org.pf.util.ExceptionIgnorer |
|---|
exceptionOccurred, getExceptionHandler, setExceptionHandler |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextSocketConnection(java.net.Socket openSocket)
public TextSocketConnection(java.net.Socket openSocket,
ExceptionHandler exHandler)
| Method Detail |
|---|
public void close()
close in class SocketConnectionpublic java.lang.String readLine()
public boolean write(java.lang.String text)
public boolean writeLine(java.lang.String line)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||