public interface ListeningContextFace
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_TRAP_PORT
The default port number where we listen for traps (162).
|
static java.lang.String |
version_id |
| Modifier and Type | Method and Description |
|---|---|
void |
addRawPduListener(RawPduListener l)
Adds the specified PDU listener to receive the undecoded PDUs.
|
void |
addUnhandledRawPduListener(RawPduListener listener)
Adds the specified PDU listener to receive the undecoded PDUs when
it was not handled (i.e. not consumed) by any of the PDU listeners in
addRawPduListener().
|
void |
destroy()
Removes the resouces held by this context.
|
java.lang.String |
getBindAddress()
Returns the local address the server will bind to
When the address is null, the socket accepts connections on
any/all local addresses.
|
int |
getMaxRecvSize()
Returns the maximum number of bytes this context will read from the
socket.
|
int |
getPort()
Returns the port number.
|
java.lang.String |
getTypeSocket()
Returns the type of socket.
|
void |
removeRawPduListener(RawPduListener l)
Removes the specified PDU listener.
|
void |
removeUnhandledRawPduListener(RawPduListener listener)
Removes the specified unhandled PDU listener.
|
void |
setMaxRecvSize(int no)
Sets the maximum number of bytes this context will read from the
socket.
|
static final java.lang.String version_id
static final int DEFAULT_TRAP_PORT
int getPort()
java.lang.String getBindAddress()
java.lang.String getTypeSocket()
SnmpContextBasisFace.STANDARD_SOCKET,
SnmpContextBasisFace.TCP_SOCKETint getMaxRecvSize()
MSS (i.e. 1300).SnmpContextBasisFace.MSS,
setMaxRecvSize(int),
AbstractSnmpContext.setMaxRecvSize(int)void setMaxRecvSize(int no)
MSS (i.e. 1300).no - The new sizeSnmpContextBasisFace.MSS,
AbstractSnmpContext.getMaxRecvSize()void destroy()
void addRawPduListener(RawPduListener l) throws java.io.IOException
All the SnmpContext objects use this method to listen for PDUs. When a SnmpContext object decodes the PDU succesfully, it will consume it.
Only when a listener is added will this context create a listening socket.
l - The listener objectjava.io.IOException - Thrown when creating a listening
socket failsRawPduReceivedSupport.fireRawPduReceived(int, java.lang.String, int, byte[]),
AbstractSnmpContext.addTrapListener(uk.co.westhawk.snmp.event.TrapListener),
AbstractSnmpContext.addRequestPduListener(uk.co.westhawk.snmp.event.RequestPduListener),
addUnhandledRawPduListener(RawPduListener)void removeRawPduListener(RawPduListener l)
l - The listener objectvoid addUnhandledRawPduListener(RawPduListener listener) throws java.io.IOException
Only when a listener is added will this context create a listening socket.
listener - The listener objectjava.io.IOException - Thrown when creating a listening
socket failsaddRawPduListener(RawPduListener)void removeUnhandledRawPduListener(RawPduListener listener)
listener - The listener object