java.lang.Object
org.snmp4j.transport.AbstractTcpServerThread<DefaultTcpTransportMapping.SocketEntry>
org.snmp4j.transport.DefaultTcpTransportMapping.ServerThread
- All Implemented Interfaces:
Runnable,WorkerTask
- Enclosing class:
DefaultTcpTransportMapping
protected class DefaultTcpTransportMapping.ServerThread
extends AbstractTcpServerThread<DefaultTcpTransportMapping.SocketEntry>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]private Throwableprivate ServerSocketChannelprivate booleanFields inherited from class org.snmp4j.transport.AbstractTcpServerThread
pending, selector, tcpTransportMapping -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()private voiddispatchMessage(TcpAddress incomingAddress, ByteBuffer byteBuffer, long bytesRead, Object sessionID) voidInterrupts this task.voidjoin()Waits until this task has been finished.private voidprotected booleanreadMessage(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress) protected voidreadSnmpMessagePayload(SocketChannel readChannel, TcpAddress incomingAddress, DefaultTcpTransportMapping.SocketEntry entry, ByteBuffer byteBuffer) removeSocketEntry(TcpAddress incomingAddress) voidrun()voidsendMessage(Address address, byte[] message, TransportStateReference tmStateReference) voidTheWorkerPoolmight call this method to hint the activeWorkTaskinstance to complete execution as soon as possible.Methods inherited from class org.snmp4j.transport.AbstractTcpServerThread
closeChannel, connectChannel, connectSocketToSendMessage, writeData
-
Field Details
-
buf
protected byte[] buf -
stop
private volatile boolean stop -
lastError
-
ssc
-
-
Constructor Details
-
ServerThread
- Throws:
IOException
-
-
Method Details
-
processPending
private void processPending() -
getLastError
-
sendMessage
public void sendMessage(Address address, byte[] message, TransportStateReference tmStateReference) throws IOException - Throws:
IOException
-
run
public void run()- Specified by:
runin interfaceRunnable- Specified by:
runin classAbstractTcpServerThread<DefaultTcpTransportMapping.SocketEntry>
-
removeSocketEntry
- Specified by:
removeSocketEntryin classAbstractTcpServerThread<DefaultTcpTransportMapping.SocketEntry>
-
readMessage
protected boolean readMessage(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress) throws IOException - Throws:
IOException
-
readSnmpMessagePayload
protected void readSnmpMessagePayload(SocketChannel readChannel, TcpAddress incomingAddress, DefaultTcpTransportMapping.SocketEntry entry, ByteBuffer byteBuffer) throws IOException - Throws:
IOException
-
dispatchMessage
private void dispatchMessage(TcpAddress incomingAddress, ByteBuffer byteBuffer, long bytesRead, Object sessionID) -
close
public void close()- Overrides:
closein classAbstractTcpServerThread<DefaultTcpTransportMapping.SocketEntry>
-
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- Overrides:
terminatein classAbstractTcpServerThread<DefaultTcpTransportMapping.SocketEntry>
-
join
public void join()Description copied from interface:WorkerTaskWaits until this task has been finished.- Specified by:
joinin interfaceWorkerTask- Overrides:
joinin classAbstractTcpServerThread<DefaultTcpTransportMapping.SocketEntry>
-
interrupt
public void interrupt()Description copied from interface:WorkerTaskInterrupts this task.- Specified by:
interruptin interfaceWorkerTask- Overrides:
interruptin classAbstractTcpServerThread<DefaultTcpTransportMapping.SocketEntry>- See Also:
-