Package org.snmp4j.transport
Class DefaultTcpTransportMapping.ServerThread
java.lang.Object
org.snmp4j.transport.DefaultTcpTransportMapping.ServerThread
- All Implemented Interfaces:
Runnable,WorkerTask
- Enclosing class:
DefaultTcpTransportMapping
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidconnectSocketToSendMessage(Address address, byte[] message, SocketChannel socketChannel, org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry entry, Map<Address, org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry> sockets) voidInterrupts this task.voidjoin()Waits until this task has been finished.protected booleanreadMessage(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress) protected voidreadSnmpMessagePayload(SocketChannel readChannel, TcpAddress incomingAddress, org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry entry, ByteBuffer byteBuffer) voidrun()voidsendMessage(Address address, byte[] message, TransportStateReference tmStateReference) voidTheWorkerPoolmight call this method to hint the activeWorkTaskinstance to complete execution as soon as possible.
-
Field Details
-
buf
protected byte[] buf -
selector
-
-
Constructor Details
-
ServerThread
- Throws:
IOException
-
-
Method Details
-
connectSocketToSendMessage
protected void connectSocketToSendMessage(Address address, byte[] message, SocketChannel socketChannel, org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry entry, Map<Address, org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry> sockets) throws ClosedChannelException- Throws:
ClosedChannelException
-
getLastError
-
sendMessage
public void sendMessage(Address address, byte[] message, TransportStateReference tmStateReference) throws IOException - Throws:
IOException
-
run
public void run() -
readMessage
protected boolean readMessage(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress) throws IOException - Throws:
IOException
-
readSnmpMessagePayload
protected void readSnmpMessagePayload(SocketChannel readChannel, TcpAddress incomingAddress, org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry entry, ByteBuffer byteBuffer) throws IOException - Throws:
IOException
-
close
public void close() -
terminate
public void terminate()Description copied from interface:WorkerTaskTheWorkerPoolmight call this method to hint the activeWorkTaskinstance to complete execution as soon as possible.- Specified by:
terminatein interfaceWorkerTask
-
join
public void join()Description copied from interface:WorkerTaskWaits until this task has been finished.- Specified by:
joinin interfaceWorkerTask
-
interrupt
public void interrupt()Description copied from interface:WorkerTaskInterrupts this task.- Specified by:
interruptin interfaceWorkerTask- See Also:
-