protected class DefaultTcpTransportMapping.ServerThread extends Object implements WorkerTask
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
buf |
protected Selector |
selector |
| Constructor and Description |
|---|
ServerThread() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
connectSocketToSendMessage(Address address,
byte[] message,
Socket s,
org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry entry,
Map<Address,org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry> sockets) |
Throwable |
getLastError() |
void |
interrupt()
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,
org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry entry,
ByteBuffer byteBuffer) |
void |
run() |
void |
sendMessage(Address address,
byte[] message,
TransportStateReference tmStateReference) |
void |
terminate()
The
WorkerPool might call this method to hint the active
WorkTask instance to complete execution as soon as possible. |
protected byte[] buf
protected Selector selector
public ServerThread()
throws IOException
IOExceptionprotected void connectSocketToSendMessage(Address address, byte[] message, Socket s, org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry entry, Map<Address,org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry> sockets)
public Throwable getLastError()
public void sendMessage(Address address, byte[] message, TransportStateReference tmStateReference) throws IOException
IOExceptionprotected boolean readMessage(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress) throws IOException
IOExceptionprotected void readSnmpMessagePayload(SocketChannel readChannel, TcpAddress incomingAddress, org.snmp4j.transport.DefaultTcpTransportMapping.SocketEntry entry, ByteBuffer byteBuffer) throws IOException
IOExceptionpublic void close()
public void terminate()
WorkerTaskWorkerPool might call this method to hint the active
WorkTask instance to complete execution as soon as possible.terminate in interface WorkerTaskpublic void join()
WorkerTaskjoin in interface WorkerTaskpublic void interrupt()
WorkerTaskinterrupt in interface WorkerTaskThread.interrupt()Copyright © 2020 SNMP4J.org. All rights reserved.