java.lang.Object
org.snmp4j.transport.AbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
org.snmp4j.transport.DefaultTcpTransportMapping.ServerThread
- All Implemented Interfaces:
Runnable
,WorkerTask
- Enclosing class:
- DefaultTcpTransportMapping
protected class DefaultTcpTransportMapping.ServerThread
extends AbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
Field Summary
FieldsFields inherited from class org.snmp4j.transport.AbstractTransportServerThread
pending, selector, transportMapping
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected TcpAddress
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, DefaultTcpTransportMapping.SocketEntry entry, ByteBuffer byteBuffer)
removeSocketEntry(TcpAddress incomingAddress)
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.Methods inherited from class org.snmp4j.transport.AbstractTransportServerThread
closeChannel, connectChannel, connectSocketToSendMessage, writeData, writeMessage
-
Field Details
-
buf
protected byte[] buf
-
-
Constructor Details
-
ServerThread
- Throws:
IOException
-
-
Method Details
-
getLastError
-
sendMessage
public void sendMessage(Address address, byte[] message, TransportStateReference tmStateReference) throws IOException- Throws:
IOException
-
run
public void run()- Specified by:
run
in interfaceRunnable
- Specified by:
run
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
removeSocketEntry
- Specified by:
removeSocketEntry
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
createIncomingAddress
- Specified by:
createIncomingAddress
in classAbstractTransportServerThread<TcpAddress,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
-
close
public void close()- Overrides:
close
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
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
- Overrides:
terminate
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
join
public void join()Description copied from interface:WorkerTask
Waits until this task has been finished.- Specified by:
join
in interfaceWorkerTask
- Overrides:
join
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
interrupt
public void interrupt()Description copied from interface:WorkerTask
Interrupts this task.- Specified by:
interrupt
in interfaceWorkerTask
- Overrides:
interrupt
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
- See Also:
Thread.interrupt()
-