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, serverAddress, ssc, stop, transportMapping -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TcpAddressprotected DefaultTcpTransportMapping.SocketEntrycreateSocketEntry(TcpAddress address, SocketChannel socketChannel, boolean useClientMode, TransportStateReference tmStateReference) protected SocketChannelopenSocketChannel(ProtocolFamily family) protected voidprotected booleanreadMessage(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress, DefaultTcpTransportMapping.SocketEntry socketEntry) protected voidreadSnmpMessagePayload(SocketChannel readChannel, TcpAddress incomingAddress, DefaultTcpTransportMapping.SocketEntry entry, ByteBuffer byteBuffer) removeSocketEntry(TcpAddress incomingAddress) voidrun()Methods inherited from class org.snmp4j.transport.AbstractTransportServerThread
close, closeChannel, connectChannel, connectSocketToSendMessage, doServer, fireIncrementCounterSessionClose, getSelector, interrupt, join, sendMessage, terminate, writeData, writeMessage
-
Field Details
-
buf
protected byte[] buf
-
-
Constructor Details
-
ServerThread
- Throws:
IOException
-
-
Method Details
-
getLastError
-
createSocketEntry
protected DefaultTcpTransportMapping.SocketEntry createSocketEntry(TcpAddress address, SocketChannel socketChannel, boolean useClientMode, TransportStateReference tmStateReference) - Specified by:
createSocketEntryin classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
openSocketChannel
- Specified by:
openSocketChannelin classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry> - Throws:
IOException
-
run
public void run()- Specified by:
runin interfaceRunnable- Specified by:
runin classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
readMessage
protected boolean readMessage(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress, DefaultTcpTransportMapping.SocketEntry socketEntry) throws IOException - Specified by:
readMessagein classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry> - Throws:
IOException
-
processQueues
protected void processQueues()- Specified by:
processQueuesin classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
removeSocketEntry
- Specified by:
removeSocketEntryin classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
createIncomingAddress
- Specified by:
createIncomingAddressin classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry> - Throws:
IOException
-
readSnmpMessagePayload
protected void readSnmpMessagePayload(SocketChannel readChannel, TcpAddress incomingAddress, DefaultTcpTransportMapping.SocketEntry entry, ByteBuffer byteBuffer) throws IOException - Throws:
IOException
-