public class ServerSocketComm extends Object implements ISocketComm
Modifier and Type | Class and Description |
---|---|
static class |
ServerSocketComm.State
The state of the communication link.
|
Modifier and Type | Field and Description |
---|---|
ServerSocketCommProps |
properties
The properties for the socket.
|
Constructor and Description |
---|
ServerSocketComm(ServerSocketCommProps properties,
Worker worker,
ServerSocketCommListener listener)
Creates a new Server Socket Communication channel as UNINITIALIZED.
|
Modifier and Type | Method and Description |
---|---|
void |
checkTimeout(long timeNow)
Performs a timeout check for the socket channel.
|
boolean |
close()
Call this method to close the socket.
|
boolean |
close(boolean rightNow)
Call this method to close the socket.
|
long |
getRemainingTimeout(long timeNow)
Gets the socket timeout value remaining.
|
ServerSocketComm.State |
getState()
Gets the state of the connection.
|
boolean |
isClosed()
Checks if the connection is disposed of.
|
void |
open()
Opens the communication.
|
void |
process(ByteBuffer buffer)
Processes the SelectionKey as it has generated an event.
|
public final ServerSocketCommProps properties
public ServerSocketComm(ServerSocketCommProps properties, Worker worker, ServerSocketCommListener listener)
properties
- The server socket properties.worker
- The worker thread for socket processing.listener
- The listener for server socket events.public void open() throws IOException
IOException
public void process(ByteBuffer buffer)
process
in interface ISocketComm
buffer
- The direct buffer allocated by the worker.public ServerSocketComm.State getState()
public boolean isClosed()
public boolean close()
public boolean close(boolean rightNow)
close
in interface ISocketComm
rightNow
- In thins implementation this flag has no effect.public long getRemainingTimeout(long timeNow)
The Server Socket Communication always returns -1 for indefinite timeout.
getRemainingTimeout
in interface IWorkerTimeout
timeNow
- The current time.public void checkTimeout(long timeNow)
The Server Socket Communication performs nothing for this method.
checkTimeout
in interface IWorkerTimeout
timeNow
- The current time.iizi® is a registered trademark of Mindus SARL. © Copyright 2019 Mindus SARL. All rights reserved.