java.lang.Object
org.snmp4j.transport.AbstractTcpServerThread<TLSTM.SocketEntry>
org.snmp4j.transport.TLSTM.ServerThread
- All Implemented Interfaces:
Runnable,WorkerTask
- Enclosing class:
TLSTM
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockingQueue<TLSTM.SocketEntry> private Throwableprivate final BlockingQueue<TLSTM.SocketEntry> private ServerSocketChannelFields inherited from class org.snmp4j.transport.AbstractTcpServerThread
pending, selector, stop, tcpTransportMapping -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcloseChannelAndRemoveSocket(TLSTM.SocketEntry entry, IOException ioException) private voiddispatchMessage(TcpAddress incomingAddress, ByteBuffer byteBuffer, long bytesRead, Object sessionID, TransportStateReference tmStateReference) private booleanisConnectionClosed(TLSTM.SocketEntry entry, IOException ioException) private voidprivate voidprivate voidreadMessage(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress, TLSTM.SocketEntry session) removeSocketEntry(TcpAddress incomingAddress) voidrun()booleanrunDelegatedTasks(SSLEngineResult result, TLSTM.SocketEntry entry) If the result indicates that we have outstanding tasks to do, go ahead and run them in this thread.voidsendMessage(Address address, byte[] message, TransportStateReference tmStateReference) protected TcpAddresswriteData(SelectionKey sk, TcpAddress incomingAddress) private voidwriteMessage(TLSTM.SocketEntry entry, SocketChannel sc) Methods inherited from class org.snmp4j.transport.AbstractTcpServerThread
close, closeChannel, connectChannel, connectSocketToSendMessage, interrupt, join, terminate
-
Field Details
-
lastError
-
ssc
-
outQueue
-
inQueue
-
-
Constructor Details
-
ServerThread
- Throws:
IOExceptionNoSuchAlgorithmException
-
-
Method Details
-
processQueues
private void processQueues() -
isConnectionClosed
-
closeChannelAndRemoveSocket
-
processPending
private void processPending() -
runDelegatedTasks
public boolean runDelegatedTasks(SSLEngineResult result, TLSTM.SocketEntry entry) throws IOException If the result indicates that we have outstanding tasks to do, go ahead and run them in this thread.- Parameters:
result- the SSLEngine wrap/unwrap result.entry- the session to use.- Returns:
trueif processing of delegated tasks has been finished,falseotherwise.- Throws:
IOException
-
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<TLSTM.SocketEntry>
-
removeSocketEntry
- Specified by:
removeSocketEntryin classAbstractTcpServerThread<TLSTM.SocketEntry>
-
writeData
- Overrides:
writeDatain classAbstractTcpServerThread<TLSTM.SocketEntry>
-
readMessage
private void readMessage(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress, TLSTM.SocketEntry session) throws IOException - Throws:
IOException
-
dispatchMessage
private void dispatchMessage(TcpAddress incomingAddress, ByteBuffer byteBuffer, long bytesRead, Object sessionID, TransportStateReference tmStateReference) -
writeMessage
- Throws:
IOException
-