public class ClientSideNetworkAgent extends java.lang.Object implements INetworkAgent
| Constructor and Description |
|---|
ClientSideNetworkAgent()
Instantiates a new client side network agent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the socket.
|
void |
connect(java.net.SocketAddress objSocketAddress,
int itimeout)
Connect to the given Socket Address.
|
java.net.InetSocketAddress |
getSocketAddress()
Implementation of this method returns Socket Address used for communication.
|
byte[] |
read(int iSize)
Reads the specified number of bytes from the socket input stream.
|
void |
write(byte[] buffer)
Write the given byte array to the socket output stream.
|
public ClientSideNetworkAgent()
java.io.IOException - Signals that an I/O exception has occurred.public void connect(java.net.SocketAddress objSocketAddress,
int itimeout)
throws java.io.IOException
objSocketAddress - the socket address to which connection is to be madejava.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 readjava.io.IOException - Signals that an IO Exception occurs.public void write(byte[] buffer)
throws java.io.IOException
write in interface INetworkAgentbuffer - byte array to be written to the socket outputstreamjava.io.IOException - Signals that an IO Exception occurs.public void close()
close in interface INetworkAgentpublic java.net.InetSocketAddress getSocketAddress()
INetworkAgentgetSocketAddress in interface INetworkAgent