public class ServerSideNetworkAgent extends java.lang.Thread implements INetworkAgent
| Constructor and Description |
|---|
ServerSideNetworkAgent(java.net.Socket socket)
Instantiates ServerSideNetworkAgent with specified Socket
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBufferReceiver(IBufferReceiver objIMessageBufferReceiver)
Sets IBufferReceiver on AuxAgent.
|
void |
close()
Closes the socket.
|
void |
read()
Reads Data From Input Stream of Underlying Socket with Packet Size of 1MB.
|
void |
run()
Run Method.
|
void |
setConnectionListener(IConnectionListener objIConnectionListener)
Sets ConnectionListener.
|
void |
setReadWriteLength(int iReadLength,
int iWriteLength)
Sets max length limit of reading and writing.
|
void |
write(byte[] buffer)
Writes data on Output Stream of Underlying Socket.
|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic ServerSideNetworkAgent(java.net.Socket socket)
throws java.io.IOException
socket - the socketjava.io.IOException - Signals that an IO Exception has occurred.public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void setReadWriteLength(int iReadLength,
int iWriteLength)
iReadLength - value of Reading max lengthiWriteLength - value of Writing max lengthpublic void read()
throws java.lang.InterruptedException,
java.io.IOException
read in interface INetworkAgentjava.lang.InterruptedException - thrown when reading method is interruptedjava.io.IOException - Signals that an IO Exception has occurred.public void write(byte[] buffer)
throws java.io.IOException
write in interface INetworkAgentbuffer - the buffer to be writtenjava.io.IOException - Signals that an IO Exception has occurred.public void addBufferReceiver(IBufferReceiver objIMessageBufferReceiver)
objIMessageBufferReceiver - - obj of MessageBufferReceiverpublic void setConnectionListener(IConnectionListener objIConnectionListener)
setConnectionListener in interface INetworkAgentIConnectionListener--object - of ConnectionListenerpublic void close()
throws java.io.IOException
java.io.IOException