public interface IDatagramSession extends ISession
ISession
interface to cover datagram-oriented functionalities.Modifier and Type | Method and Description |
---|---|
IDatagramHandler |
getHandler()
Gets the datagram-oriented handler associated with this session
|
IDatagramSession |
getParent()
Gets the parent session.
|
IFuture<Void> |
send(SocketAddress remoteAddress,
byte[] datagram)
Sends a
datagram.length byte datagram from the specified
byte array to a remote end via the datagram-oriented channel associated
with this session. |
IFuture<Void> |
send(SocketAddress remoteAddress,
byte[] datagram,
int offset,
int length)
Sends a
length byte datagram from the specified byte array
to a remote end via the datagram-oriented channel associated with this
session. |
IFuture<Void> |
send(SocketAddress remoteAddress,
ByteBuffer datagram)
Sends a
datagram.remaining() byte datagram from the specified byte
buffer to a remote end via the datagram-oriented channel associated with this
session. |
IFuture<Void> |
send(SocketAddress remoteAddress,
ByteBuffer datagram,
int length)
Sends a
length byte datagram from the specified byte buffer
to a remote end via the datagram-oriented channel associated with this
session. |
IFuture<Void> |
send(SocketAddress remoteAddress,
Object msg)
Sends a message to a remote end via the datagram-oriented channel
associated with this session.
|
void |
sendnf(SocketAddress remoteAddress,
byte[] datagram)
Sends a
datagram.length byte datagram from the specified
byte array to a remote end via the datagram-oriented channel associated
with this session. |
void |
sendnf(SocketAddress remoteAddress,
byte[] datagram,
int offset,
int length)
Sends a
length byte datagram from the specified byte array
to a remote end via the datagram-oriented channel associated with this
session. |
void |
sendnf(SocketAddress remoteAddress,
ByteBuffer datagram)
Sends a
datagram.remaining() byte datagram from the specified byte
buffer to a remote end via the datagram-oriented channel associated with this
session. |
void |
sendnf(SocketAddress remoteAddress,
ByteBuffer datagram,
int length)
Sends a
length byte datagram from the specified byte buffer
to a remote end via the datagram-oriented channel associated with this
session. |
void |
sendnf(SocketAddress remoteAddress,
Object msg)
Sends a message to a remote end via the datagram-oriented channel
associated with this session.
|
IFuture<Void> |
write(byte[] datagram)
Writes a
datagram.length byte datagram from the specified
byte array to the datagram-oriented channel associated with this session. |
IFuture<Void> |
write(byte[] datagram,
int offset,
int length)
Writes a
length byte datagram from the specified byte array
to the datagram-oriented channel associated with this session. |
IFuture<Void> |
write(ByteBuffer datagram)
Writes a
datagram.remaining() byte datagram from the specified byte buffer
to the datagram-oriented channel associated with this session. |
IFuture<Void> |
write(ByteBuffer datagram,
int length)
Writes a
length byte datagram from the specified byte buffer
to the datagram-oriented channel associated with this session. |
IFuture<Void> |
write(Object msg)
Writes a message to the datagram-oriented channel associated with this session.
|
void |
writenf(byte[] datagram)
Writes a
datagram.length byte datagram from the specified
byte array to the datagram-oriented channel associated with this session. |
void |
writenf(byte[] datagram,
int offset,
int length)
Writes a
length byte datagram from the specified byte array
to the datagram-oriented channel associated with this session. |
void |
writenf(ByteBuffer datagram)
Writes a
datagram.remaining() byte datagram from the specified byte buffer
to the datagram-oriented channel associated with this session. |
void |
writenf(ByteBuffer datagram,
int length)
Writes a
length byte datagram from the specified byte buffer
to the datagram-oriented channel associated with this session. |
void |
writenf(Object msg)
Writes a message to the datagram-oriented channel associated with this session.
|
allocate, close, dirtyClose, getAttributes, getCloseFuture, getCodecPipeline, getConfig, getCreateFuture, getCreationTime, getEndFuture, getId, getLastIoTime, getLastReadTime, getLastWriteTime, getLocalAddress, getName, getOpenFuture, getReadBytes, getReadBytesThroughput, getReadyFuture, getRemoteAddress, getState, getTimer, getWrittenBytes, getWrittenBytesThroughput, isOpen, isReadSuspended, isWriteSuspended, quickClose, release, resumeRead, resumeWrite, suspendRead, suspendWrite
IDatagramHandler getHandler()
getHandler
in interface ISession
IDatagramSession getParent()
ISession
Some sessions may not implement its own I/O functionalities and use their parent's ones instead.
IFuture<Void> write(byte[] datagram)
datagram.length
byte datagram from the specified
byte array to the datagram-oriented channel associated with this session.
This method may only be invoked if the associated channel's socket is connected, in which case it writes the datagram directly to the socket's peer.
The operation is asynchronous.
datagram
- the datagram to be writtenIllegalSessionStateException
- if this session is not openvoid writenf(byte[] datagram)
datagram.length
byte datagram from the specified
byte array to the datagram-oriented channel associated with this session.
This method may only be invoked if the associated channel's socket is connected, in which case it writes the datagram directly to the socket's peer.
The operation is asynchronous.
This method should be used whenever there will be no need to synchronize on a future object. This will save some resources and may improve performance.
datagram
- the datagram to be writtenIllegalSessionStateException
- if this session is not openIFuture<Void> write(byte[] datagram, int offset, int length)
length
byte datagram from the specified byte array
to the datagram-oriented channel associated with this session.
This method may only be invoked if the associated channel's socket is connected, in which case it writes the datagram directly to the socket's peer.
The operation is asynchronous.
datagram
- the datagram to be writtenoffset
- offset within the array of the first byte to be writtenlength
- number of bytes to be writtenIllegalSessionStateException
- if this session is not openvoid writenf(byte[] datagram, int offset, int length)
length
byte datagram from the specified byte array
to the datagram-oriented channel associated with this session.
This method may only be invoked if the associated channel's socket is connected, in which case it writes the datagram directly to the socket's peer.
The operation is asynchronous.
This method should be used whenever there will be no need to synchronize on a future object. This will save some resources and may improve performance.
datagram
- the datagram to be writtenoffset
- offset within the array of the first byte to be writtenlength
- number of bytes to be writtenIllegalSessionStateException
- if this session is not openIFuture<Void> write(ByteBuffer datagram)
datagram.remaining()
byte datagram from the specified byte buffer
to the datagram-oriented channel associated with this session.
This method may only be invoked if the associated channel's socket is connected, in which case it writes the datagram directly to the socket's peer.
The operation is asynchronous.
datagram
- the datagram to be writtenIllegalSessionStateException
- if this session is not openvoid writenf(ByteBuffer datagram)
datagram.remaining()
byte datagram from the specified byte buffer
to the datagram-oriented channel associated with this session.
This method may only be invoked if the associated channel's socket is connected, in which case it writes the datagram directly to the socket's peer.
The operation is asynchronous.
This method should be used whenever there will be no need to synchronize on a future object. This will save some resources and may improve performance.
datagram
- the datagram to be writtenIllegalSessionStateException
- if this session is not openIFuture<Void> write(ByteBuffer datagram, int length)
length
byte datagram from the specified byte buffer
to the datagram-oriented channel associated with this session.
This method may only be invoked if the associated channel's socket is connected, in which case it writes the datagram directly to the socket's peer.
The operation is asynchronous.
datagram
- the datagram to be writtenlength
- number of bytes to be writtenIllegalSessionStateException
- if this session is not openvoid writenf(ByteBuffer datagram, int length)
length
byte datagram from the specified byte buffer
to the datagram-oriented channel associated with this session.
This method may only be invoked if the associated channel's socket is connected, in which case it writes the datagram directly to the socket's peer.
The operation is asynchronous.
This method should be used whenever there will be no need to synchronize on a future object. This will save some resources and may improve performance.
datagram
- the datagram to be writtenlength
- number of bytes to be writtenIllegalSessionStateException
- if this session is not openIFuture<Void> write(Object msg)
This method may only be invoked if the associated channel's socket is connected, in which case it writes the message directly to the socket's peer.
The operation is asynchronous.
This method usually requires that the session has configured a codec
pipeline with at least one encoder that accepts the msg as the inbound
data. If a codec pipeline is not configured or no encoder accept the msg
object it still accepts messages that are of the byte[]
or
ByteBuffer
type.
msg
- the message to be writtenIllegalSessionStateException
- if this session is not openIllegalArgumentException
- if the msg
is an unexpected objectvoid writenf(Object msg)
This method may only be invoked if the associated channel's socket is connected, in which case it writes the message directly to the socket's peer.
The operation is asynchronous.
This method usually requires that the session has configured a codec
pipeline with at least one encoder that accepts the msg as the inbound
data. If a codec pipeline is not configured or no encoder accept the msg
object it still accepts messages that are of the byte[]
or
ByteBuffer
type.
This method should be used whenever there will be no need to synchronize on a future object. This will save some resources and may improve performance.
msg
- the message to be writtenIllegalSessionStateException
- if this session is not openIllegalArgumentException
- if the msg
is an unexpected objectIFuture<Void> send(SocketAddress remoteAddress, byte[] datagram)
datagram.length
byte datagram from the specified
byte array to a remote end via the datagram-oriented channel associated
with this session.
If the remoteAddress
argument is not null
then
the method may only be invoked if the associated channel's socket is not
connected. In case the argument is null
the method will work
as the adequate write method.
The operation is asynchronous.
remoteAddress
- the address of the remote end where the datagram should be sentdatagram
- the datagram to be sentIllegalSessionStateException
- if this session is not openvoid sendnf(SocketAddress remoteAddress, byte[] datagram)
datagram.length
byte datagram from the specified
byte array to a remote end via the datagram-oriented channel associated
with this session.
If the remoteAddress
argument is not null
then
the method may only be invoked if the associated channel's socket is not
connected. In case the argument is null
the method will work
as the adequate write method.
The operation is asynchronous.
This method should be used whenever there will be no need to synchronize on a future object. This will save some resources and may improve performance.
remoteAddress
- the address of the remote end where the datagram should be sentdatagram
- the datagram to be sentIllegalSessionStateException
- if this session is not openIFuture<Void> send(SocketAddress remoteAddress, byte[] datagram, int offset, int length)
length
byte datagram from the specified byte array
to a remote end via the datagram-oriented channel associated with this
session.
If the remoteAddress
argument is not null
then
the method may only be invoked if the associated channel's socket is not
connected. In case the argument is null
the method will work
as the adequate write method.
The operation is asynchronous.
remoteAddress
- the address of the remote end where the datagram should be sentdatagram
- the datagram to be sentoffset
- offset within the array of the first byte to be sentlength
- number of bytes to be sentIllegalSessionStateException
- if this session is not openvoid sendnf(SocketAddress remoteAddress, byte[] datagram, int offset, int length)
length
byte datagram from the specified byte array
to a remote end via the datagram-oriented channel associated with this
session.
If the remoteAddress
argument is not null
then
the method may only be invoked if the associated channel's socket is not
connected. In case the argument is null
the method will work
as the adequate write method.
The operation is asynchronous.
This method should be used whenever there will be no need to synchronize on a future object. This will save some resources and may improve performance.
remoteAddress
- the address of the remote end where the datagram should be sentdatagram
- the datagram to be sentoffset
- offset within the array of the first byte to be sentlength
- number of bytes to be sentIllegalSessionStateException
- if this session is not openIFuture<Void> send(SocketAddress remoteAddress, ByteBuffer datagram)
datagram.remaining()
byte datagram from the specified byte
buffer to a remote end via the datagram-oriented channel associated with this
session.
If the remoteAddress
argument is not null
then
the method may only be invoked if the associated channel's socket is not
connected. In case the argument is null
the method will work
as the adequate write method.
The operation is asynchronous.
remoteAddress
- the address of the remote end where the datagram should be sentdatagram
- the datagram to be sentIllegalSessionStateException
- if this session is not openvoid sendnf(SocketAddress remoteAddress, ByteBuffer datagram)
datagram.remaining()
byte datagram from the specified byte
buffer to a remote end via the datagram-oriented channel associated with this
session.
If the remoteAddress
argument is not null
then
the method may only be invoked if the associated channel's socket is not
connected. In case the argument is null
the method will work
as the adequate write method.
The operation is asynchronous.
This method should be used whenever there will be no need to synchronize on a future object. This will save some resources and may improve performance.
remoteAddress
- the address of the remote end where the datagram should be sentdatagram
- the datagram to be sentIllegalSessionStateException
- if this session is not openIFuture<Void> send(SocketAddress remoteAddress, ByteBuffer datagram, int length)
length
byte datagram from the specified byte buffer
to a remote end via the datagram-oriented channel associated with this
session.
If the remoteAddress
argument is not null
then
the method may only be invoked if the associated channel's socket is not
connected. In case the argument is null
the method will work
as the adequate write method.
The operation is asynchronous.
remoteAddress
- the address of the remote end where the datagram should be sentdatagram
- the datagram to be sentlength
- number of bytes to be sentIllegalSessionStateException
- if this session is not openvoid sendnf(SocketAddress remoteAddress, ByteBuffer datagram, int length)
length
byte datagram from the specified byte buffer
to a remote end via the datagram-oriented channel associated with this
session.
If the remoteAddress
argument is not null
then
the method may only be invoked if the associated channel's socket is not
connected. In case the argument is null
the method will work
as the adequate write method.
The operation is asynchronous.
This method should be used whenever there will be no need to synchronize on a future object. This will save some resources and may improve performance.
remoteAddress
- the address of the remote end where the datagram should be sentdatagram
- the datagram to be sentlength
- number of bytes to be sentIllegalSessionStateException
- if this session is not openIFuture<Void> send(SocketAddress remoteAddress, Object msg)
If the remoteAddress
argument is not null
then
the method may only be invoked if the associated channel's socket is not
connected. In case the argument is null
the method will work
as the adequate write method.
The operation is asynchronous.
This method usually requires that the session has configured a codec
pipeline with at least one encoder that accepts the msg as the inbound
data. If a codec pipeline is not configured or no encoder accept the msg
object it still accepts messages that are of the byte[]
or
ByteBuffer
type.
remoteAddress
- the address of the remote end where the message should be sentmsg
- the message to be sentIllegalSessionStateException
- if this session is not openIllegalArgumentException
- if the msg
is an unexpected objectvoid sendnf(SocketAddress remoteAddress, Object msg)
If the remoteAddress
argument is not null
then
the method may only be invoked if the associated channel's socket is not
connected. In case the argument is null
the method will work
as the adequate write method.
The operation is asynchronous.
This method usually requires that the session has configured a codec
pipeline with at least one encoder that accepts the msg as the inbound
data. If a codec pipeline is not configured or no encoder accept the msg
object it still accepts messages that are of the byte[]
or
ByteBuffer
type.
This method should be used whenever there will be no need to synchronize on a future object. This will save some resources and may improve performance.
remoteAddress
- the address of the remote end where the message should be sentmsg
- the message to be sentIllegalSessionStateException
- if this session is not openIllegalArgumentException
- if the msg
is an unexpected objectCopyright © 2017–2021 SNF4J.ORG. All rights reserved.