public interface Server
Server
class is internally managed by the ETA Transport Package, and the application
does not need to create nor destroy this type.
The Server
is typically used to accept or reject incoming connection attempts.Modifier and Type | Method and Description |
---|---|
Channel |
accept(AcceptOptions opts,
Error error)
Accepts an incoming connection and returns a channel which corresponds to
it.
Typical use: After a server is created using the Bind call, the Accept call can be made. |
int |
bufferUsage(Error error)
Returns the total number of used buffers for the server.
Typical use: This method can be called to find out the number of used buffers for the server. |
int |
close(Error error)
Closes a ETA Server.
Typical use: When done using a Server, this call closes it. |
int |
connectionType()
The current connection type of the server.
|
int |
info(ServerInfo info,
Error error)
Gets information about the server.
Typical use: If information about the Server is needed, such as
peakBufferUsage, this method can be called to retrieve this information. |
int |
ioctl(int code,
int value,
Error error)
Allows changing some I/O values programmatically for a ETA Server.
Typical use: If an I/O value needs to be changed for a server, this is used. |
int |
ioctl(int code,
java.lang.Object value,
Error error)
Allows changing some I/O values programmatically for a ETA Server.
Typical use: If an I/O value needs to be changed for a server, this is used. |
int |
portNumber()
Port number this server is bound to.
|
java.nio.channels.SelectableChannel |
selectableChannel()
SelectableChannel of this ETA server.
|
java.nio.channels.ServerSocketChannel |
srvrScktChannel()
Deprecated.
use
selectableChannel() instead |
int |
state()
The state associated with this
Server . |
java.lang.Object |
userSpecObject()
A user specified object, possibly a closure.
|
int info(ServerInfo info, Error error)
Server
is needed, such as
peakBufferUsage, this method can be called to retrieve this information.info
- ETA Server Info structure to be populatederror
- ETA Error, to be populated in event of an errorTransportReturnCodes
ServerInfo
int ioctl(int code, java.lang.Object value, Error error)
Valid codes are:
code
- IoctlCodes
code of I/O Option to changevalue
- Value to change Option toerror
- Error
to be populated in event of an errorTransportReturnCodes
IoctlCodes
int ioctl(int code, int value, Error error)
Valid codes are:
IoctlCodes.SERVER_NUM_POOL_BUFFERS
- the return code will be
the new value of sharedPoolSize or
TransportReturnCodes.FAILURE
. If the
value is less than the number of free buffers in the shared pool (due
to buffers being in use), the shared pool will be reduced by the
number of free buffers.IoctlCodes.SYSTEM_READ_BUFFERS
- for values larger than 64K,
use BindOptions.sysRecvBufSize(int)
to set the receive buffer
size, prior to calling Transport.bind(BindOptions, Error)
.code
- IoctlCodes
code of I/O Option to changevalue
- Value to change Option toerror
- Error
to be populated in event of an errorTransportReturnCodes
or a positive number specific to the specified code.BindOptions
int bufferUsage(Error error)
error
- ETA Error, to be populated in event of an errorTransportReturnCodes
,
otherwise it is the total number of buffers in use by the serverint close(Error error)
error
- ETA Error, to be populated in event of an errorTransportReturnCodes
Channel accept(AcceptOptions opts, Error error)
Channel
is returned which corresponds to this
connection. This channel can be used to read or write with the connected
client. If a clients connect message is not accepted, a negative
acknowledgment is sent to the client and no Channel
is returned.opts
- ETA Accept Optionserror
- ETA Error, to be populated in event of an errorAcceptOptions
@Deprecated java.nio.channels.ServerSocketChannel srvrScktChannel()
selectableChannel()
insteadjava.nio.channels.SelectableChannel selectableChannel()
int portNumber()
java.lang.Object userSpecObject()
Server
with
other user created information, such as a list of associated
Channel
structures.int state()
Server
.ChannelState
int connectionType()
ConnectionTypes.SOCKET
or ConnectionTypes.ENCRYPTED
.Copyright @ 2022 Refinitiv. All Rights Reserved.