public class ClientSideNetworkAgent extends java.lang.Thread implements INetworkAgent
| Constructor and Description |
|---|
ClientSideNetworkAgent()
Instantiates a new ClientSideNetworkAgent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBufferReceiver(IBufferReceiver objIMessageBufferReceiver)
Sets IBufferReceiver on AuxAgent.
|
void |
close()
Closes the socket.
|
void |
connect(java.net.SocketAddress objSocketAddress,
int itimeout)
Connect to specified socket address
|
java.io.InputStream |
getSocketInputstream()
Retrieves Socket InputStream
|
java.io.OutputStream |
getSocketOutputstream()
Retrieves Socket OutputStream
|
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.
|
void |
setSocketInputstream(java.io.InputStream socketInputstream)
Sets SocketInputStream
|
void |
setSocketOutputstream(java.io.OutputStream socketOutputstream)
Sets Socket InputStream
|
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 ClientSideNetworkAgent()
throws java.io.IOException
java.io.IOException - Signals that an IO Exception has occurred.public java.io.InputStream getSocketInputstream()
public void setSocketInputstream(java.io.InputStream socketInputstream)
socketInputstream - instance of InputStreampublic java.io.OutputStream getSocketOutputstream()
public void setSocketOutputstream(java.io.OutputStream socketOutputstream)
socketOutputstream - instance of OutputStreampublic void setReadWriteLength(int iReadLength,
int iWriteLength)
iReadLength - value of Reading max lengthiWriteLength - value of Writing max lengthpublic void setConnectionListener(IConnectionListener objIConnectionListener)
setConnectionListener in interface INetworkAgentIConnectionListener - public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void connect(java.net.SocketAddress objSocketAddress,
int itimeout)
throws java.io.IOException
objSocketAddress - the obj socket addressjava.io.IOException - Signals that an I/O exception has occurred.public void read()
throws java.lang.InterruptedException,
java.io.IOException
read in interface INetworkAgentjava.lang.InterruptedException - thrown when read operation is interruptedjava.io.IOException - Signals that an IO Exception has occurred.public void addBufferReceiver(IBufferReceiver objIMessageBufferReceiver)
objIMessageBufferReceiver - object of Buffer Receiver.public void write(byte[] buffer)
throws java.io.IOException
write in interface INetworkAgentbuffer - the buffer to be written.java.io.IOException - Signals that an IO Exception has occurred.public void close()
throws java.io.IOException
java.io.IOException