public class ServerSideNetworkAgent extends java.lang.Object implements INetworkAgent
| Constructor and Description |
|---|
ServerSideNetworkAgent(java.net.Socket socket)
Instantiates a new server network agent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the socket.
|
java.net.InetSocketAddress |
getSocketAddress()
Implementation of this method returns Socket Address used for communication.
|
byte[] |
read(int iSize)
Read the number of bytes and returns a byte array.
|
void |
write(byte[] buffer)
Write given byte array to the socket output stream.
|
public ServerSideNetworkAgent(java.net.Socket socket)
throws java.io.IOException
socket - the socketjava.io.IOException - Signals that an IO Exception has occurred.public byte[] read(int iSize)
throws java.io.IOException
read in interface INetworkAgentiSize - number of bytes to be read.java.io.IOException - Signals that an IO Exception occurs.public void write(byte[] buffer)
throws java.io.IOException
write in interface INetworkAgentbuffer - the byte array to be written to socket output streamjava.io.IOException - Signals that an IO Exception occurs.public void close()
close in interface INetworkAgentpublic java.net.InetSocketAddress getSocketAddress()
INetworkAgentgetSocketAddress in interface INetworkAgent