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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
connectSocketToSendMessage
(Address address, byte[] message, SocketChannel socketChannel, org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry entry, Map<Address, org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry> sockets) void
Interrupts this task.void
join()
Waits until this task has been finished.protected boolean
readMessage
(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress) protected void
readSnmpMessagePayload
(SocketChannel readChannel, TcpAddress incomingAddress, org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry entry, ByteBuffer byteBuffer) void
run()
void
sendMessage
(Address address, byte[] message, TransportStateReference tmStateReference) void
TheWorkerPool
might call this method to hint the activeWorkTask
instance 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:WorkerTask
TheWorkerPool
might call this method to hint the activeWorkTask
instance to complete execution as soon as possible.- Specified by:
terminate
in interfaceWorkerTask
-
join
public void join()Description copied from interface:WorkerTask
Waits until this task has been finished.- Specified by:
join
in interfaceWorkerTask
-
interrupt
public void interrupt()Description copied from interface:WorkerTask
Interrupts this task.- Specified by:
interrupt
in interfaceWorkerTask
- See Also:
-