com.adventnet.snmp.snmp2
Class UDPTransportImpl

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.UDPTransportImpl

class UDPTransportImpl
extends java.lang.Object
implements SnmpTransportProvider


Constructor Summary
(package private) UDPTransportImpl()
           
 
Method Summary
(package private) static void ()
           
 void close()
          Closes the transport interface after communication is over.
(package private)  int getReceiveBufferSize()
           
 void open(ProtocolOptions opt)
          Opens the transport interface over which the data is sent/received.
 int read(SnmpTransportPacket buf)
          Receive data from the peer over the transport interface.
(package private)  void setReceiveBufferSize(int size)
           
 void write(SnmpTransportPacket buf)
          Sends 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
 

Constructor Detail

UDPTransportImpl

UDPTransportImpl()
Method Detail

static void ()

getReceiveBufferSize

int getReceiveBufferSize()
                   throws java.net.SocketException

setReceiveBufferSize

void setReceiveBufferSize(int size)
                    throws java.lang.IllegalArgumentException,
                           java.net.SocketException

open

public void open(ProtocolOptions opt)
          throws java.io.IOException
Description copied from interface: SnmpTransportProvider
Opens the transport interface over which the data is sent/received.
Specified by:
open in interface SnmpTransportProvider
Tags copied from interface: SnmpTransportProvider
Parameters:
options - protocol options required for opening the SNMP session.
Throws:
java.io.IOException - in case of an error during opening the transport interface.

close

public void close()
           throws java.io.IOException
Description copied from interface: SnmpTransportProvider
Closes the transport interface after communication is over.
Specified by:
close in interface SnmpTransportProvider
Tags copied from interface: SnmpTransportProvider
Throws:
java.io.IOException - in case of an error during closing.

read

public int read(SnmpTransportPacket buf)
         throws java.io.IOException
Description copied from interface: SnmpTransportProvider
Receive data from the peer over the transport interface.
Specified by:
read in interface SnmpTransportProvider
Tags copied from interface: SnmpTransportProvider
Parameters:
buf - Transport packet containing the packet buffer in which the bytes will be read.
Returns:
number of bytes actually read from the transport interface.
Throws:
java.io.IOException - in case of an error occurs while receiving.

write

public void write(SnmpTransportPacket buf)
           throws java.io.IOException
Description copied from interface: SnmpTransportProvider
Sends data to the peer over the transport interface.
Specified by:
write in interface SnmpTransportProvider
Tags copied from interface: SnmpTransportProvider
Parameters:
buf - the transport packet that contains the destination information and the SNMP message to be sent.
Throws:
java.io.IOException - in case of an error during sending.