com.adventnet.snmp.snmp2.agent
Class AgentTcpTransportImpl
java.lang.Object
|
+--com.adventnet.snmp.snmp2.agent.AgentTcpTransportImpl
- public class AgentTcpTransportImpl
- extends java.lang.Object
- implements SnmpTransportProvider
Implemention of the SnmpTransportProvider interface for TCP/IP protocol.
|
Constructor Summary |
AgentTcpTransportImpl()
Default constructor that creates an instance of the implementation
object. |
|
Method Summary |
(package private) static void |
addToSocketList(java.net.Socket socket)
|
void |
close()
Closes the transport interface after communication is over. |
void |
open(ProtocolOptions params)
Opens the transport interface over which the data is sent/received. |
int |
read(SnmpTransportPacket transportPacket)
Receive data from the peer over the transport interface. |
void |
write(SnmpTransportPacket tPacket)
Send data to the peer over the transport interface. |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
is
java.io.InputStream is
j
int j
localSocket
static java.net.Socket localSocket
lastAccessedSocket
java.net.Socket lastAccessedSocket
serverImpl
static AgentTcpReceiver serverImpl
ht
static java.util.Hashtable ht
AgentTcpTransportImpl
public AgentTcpTransportImpl()
- Default constructor that creates an instance of the implementation
object.
open
public void open(ProtocolOptions params)
throws java.io.IOException
- Opens the transport interface over which the data is sent/received.
- Specified by:
- open in interface SnmpTransportProvider
- Parameters:
params - The protocol parameters and bytes to send.- Throws:
- java.io.IOException - In case of an error during opening the
transport interface.
read
public int read(SnmpTransportPacket transportPacket)
throws java.io.IOException
- Receive data from the peer over the transport interface.
- Specified by:
- read in interface SnmpTransportProvider
- Parameters:
transportPacket - The Snmp Transport Packet from which data is to
be Read.- Returns:
- number of bytes actually read from the transport interface.
- Throws:
- java.io.IOException - in case of an error during reading.
write
public void write(SnmpTransportPacket tPacket)
throws java.io.IOException
- Send data to the peer over the transport interface.
- Specified by:
- write in interface SnmpTransportProvider
- Parameters:
tpacket - SnmpTransportPacket that contains the protocol parameters
and bytes to send.- Throws:
- java.io.IOException - in case of an error during send.
close
public void close()
throws java.io.IOException
- Closes the transport interface after communication is over.
- Specified by:
- close in interface SnmpTransportProvider
- Throws:
- java.io.IOException - on error while closing.
addToSocketList
static void addToSocketList(java.net.Socket socket)