- 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
Fields Modifier and Type Field Description protected byte[]
buf
-
Fields inherited from class org.snmp4j.transport.AbstractTransportServerThread
pending, selector, serverAddress, ssc, stop, transportMapping
-
-
Constructor Summary
Constructors Constructor Description ServerThread()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TcpAddress
createIncomingAddress(SocketChannel sc)
protected DefaultTcpTransportMapping.SocketEntry
createSocketEntry(TcpAddress address, SocketChannel socketChannel, boolean useClientMode, TransportStateReference tmStateReference)
Throwable
getLastError()
protected SocketChannel
openSocketChannel(ProtocolFamily family)
protected void
processQueues()
protected boolean
readMessage(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress, DefaultTcpTransportMapping.SocketEntry socketEntry)
protected void
readSnmpMessagePayload(SocketChannel readChannel, TcpAddress incomingAddress, DefaultTcpTransportMapping.SocketEntry entry, ByteBuffer byteBuffer)
DefaultTcpTransportMapping.SocketEntry
removeSocketEntry(TcpAddress incomingAddress)
void
run()
-
Methods inherited from class org.snmp4j.transport.AbstractTransportServerThread
close, closeChannel, connectChannel, connectSocketToSendMessage, doServer, fireIncrementCounterSessionClose, getSelector, interrupt, join, sendMessage, terminate, writeData, writeMessage
-
-
-
-
Constructor Detail
-
ServerThread
public ServerThread() throws IOException
- Throws:
IOException
-
-
Method Detail
-
getLastError
public Throwable getLastError()
-
createSocketEntry
protected DefaultTcpTransportMapping.SocketEntry createSocketEntry(TcpAddress address, SocketChannel socketChannel, boolean useClientMode, TransportStateReference tmStateReference)
- Specified by:
createSocketEntry
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
openSocketChannel
protected SocketChannel openSocketChannel(ProtocolFamily family) throws IOException
- Specified by:
openSocketChannel
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
- Throws:
IOException
-
run
public void run()
- Specified by:
run
in interfaceRunnable
- Specified by:
run
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
readMessage
protected boolean readMessage(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress, DefaultTcpTransportMapping.SocketEntry socketEntry) throws IOException
- Specified by:
readMessage
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
- Throws:
IOException
-
processQueues
protected void processQueues()
- Specified by:
processQueues
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
removeSocketEntry
public DefaultTcpTransportMapping.SocketEntry removeSocketEntry(TcpAddress incomingAddress)
- Specified by:
removeSocketEntry
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
-
createIncomingAddress
protected TcpAddress createIncomingAddress(SocketChannel sc) throws IOException
- Specified by:
createIncomingAddress
in classAbstractTransportServerThread<TcpAddress,DefaultTcpTransportMapping.SocketEntry>
- Throws:
IOException
-
readSnmpMessagePayload
protected void readSnmpMessagePayload(SocketChannel readChannel, TcpAddress incomingAddress, DefaultTcpTransportMapping.SocketEntry entry, ByteBuffer byteBuffer) throws IOException
- Throws:
IOException
-
-