|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Defines the methods necessary to communicate over the ServiceInterface with the client. Connections persist only so long as the client or the server maintains them. When either side closes the connection it will be dropped on the other end.
| Method Summary | |
void |
close()
Shut down cleanly. |
java.net.InetAddress |
getClientAddress()
Provide the client internet address. |
int |
getClientPort()
Provide the client port. |
java.lang.String |
getLine()
Reads from the low level communications channel. |
java.lang.String |
getLine(long TO)
Reads from the low level communications channel timing out after the specified time. |
int |
getServerPort()
Provide the server port often used as ID. |
void |
init()
Make sure everything is set up and ready to run. |
void |
putLine(java.lang.String ln)
Sends a single line back to the client. |
void |
putLine(java.lang.String ln,
java.net.InetAddress cAddress,
int cPort)
Sends a single line back to the client. |
int |
read(byte[] data)
Read an array-full of data. |
int |
read(byte[] data,
long TO)
Read an array-full of data timing out in the specified period. |
void |
reset()
Flush, close and re-init. |
| Method Detail |
public java.lang.String getLine()
throws ConnectionException
ConnectionException - if an error occurs
public java.lang.String getLine(long TO)
throws ConnectionException
TO - time out value in milliseconds
ConnectionException - if an error occurs
public int read(byte[] data,
long TO)
throws ConnectionException,
java.io.IOException
ConnectionException
java.io.IOException
public int read(byte[] data)
throws ConnectionException,
java.io.IOException
ConnectionException
java.io.IOExceptionpublic java.net.InetAddress getClientAddress()
public int getClientPort()
public int getServerPort()
public void putLine(java.lang.String ln)
throws ConnectionException
ln - a String value
ConnectionException - if an error occurs
public void putLine(java.lang.String ln,
java.net.InetAddress cAddress,
int cPort)
throws ConnectionException
This variant allows the caller to specify the client address and port. This is mostly used with UDP servers.
ln - a String valuecAddress - an InetAddress valuecPort - an int value
ConnectionException - if an error occurs
public void init()
throws java.io.IOException
java.io.IOException - if an error occurspublic void close()
public void reset()
throws java.io.IOException
java.io.IOException - if an error occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||