public interface IStreamSession extends ISession
ISession
interface to cover stream-oriented functionalities.Modifier and Type | Method and Description |
---|---|
IStreamHandler |
getHandler()
Gets the stream-oriented handler associated with this session
|
IStreamSession |
getParent()
Gets the parent session.
|
IFuture<Void> |
write(byte[] data)
Writes
data.length bytes from the specified byte array
to the stream-oriented channel associated with this session. |
IFuture<Void> |
write(byte[] data,
int offset,
int length)
Writes
length bytes from the specified byte array
to the stream-oriented channel associated with this session. |
IFuture<Void> |
write(ByteBuffer data)
Writes
data.remaining() bytes from the specified
byte buffer to the stream-oriented channel associated with
this session. |
IFuture<Void> |
write(ByteBuffer data,
int length)
Writes
length bytes from the specified byte buffer
to the stream-oriented channel associated with this session. |
IFuture<Void> |
write(Object msg)
Writes a message to the stream-oriented channel associated with this
session.
|
void |
writenf(byte[] data)
Writes
data.length bytes from the specified byte array
to the stream-oriented channel associated with this session. |
void |
writenf(byte[] data,
int offset,
int length)
Writes
length bytes from the specified byte array
to the stream-oriented channel associated with this session. |
void |
writenf(ByteBuffer data)
Writes
data.remaining() bytes from the specified
byte buffer to the stream-oriented channel associated with
this session. |
void |
writenf(ByteBuffer data,
int length)
Writes
length bytes from the specified byte buffer
to the stream-oriented channel associated with this session. |
void |
writenf(Object msg)
Writes a message to the stream-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
IStreamHandler getHandler()
getHandler
in interface ISession
IStreamSession getParent()
ISession
Some sessions may not implement its own I/O functionalities and use their parent's ones instead.
IFuture<Void> write(byte[] data)
data.length
bytes from the specified byte array
to the stream-oriented channel associated with this session.
The operation is asynchronous.
data
- bytes to be writtenIllegalSessionStateException
- if this session is not openvoid writenf(byte[] data)
data.length
bytes from the specified byte array
to the stream-oriented channel associated with this session.
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.
data
- bytes to be writtenIllegalSessionStateException
- if this session is not openIFuture<Void> write(byte[] data, int offset, int length)
length
bytes from the specified byte array
to the stream-oriented channel associated with this session.
The operation is asynchronous.
data
- bytes 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[] data, int offset, int length)
length
bytes from the specified byte array
to the stream-oriented channel associated with this session.
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.
data
- bytes 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 data)
data.remaining()
bytes from the specified
byte buffer to the stream-oriented channel associated with
this session.
The operation is asynchronous.
data
- bytes to be writtenIllegalSessionStateException
- if this session is not openvoid writenf(ByteBuffer data)
data.remaining()
bytes from the specified
byte buffer to the stream-oriented channel associated with
this session.
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.
data
- bytes to be writtenIllegalSessionStateException
- if this session is not openIFuture<Void> write(ByteBuffer data, int length)
length
bytes from the specified byte buffer
to the stream-oriented channel associated with this session.
The operation is asynchronous.
data
- bytes to be writtenlength
- number of bytes to be writtenIllegalSessionStateException
- if this session is not openvoid writenf(ByteBuffer data, int length)
length
bytes from the specified byte buffer
to the stream-oriented channel associated with this session.
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.
data
- bytes to be writtenlength
- number of bytes to be writtenIllegalSessionStateException
- if this session is not openIFuture<Void> write(Object msg)
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)
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 objectCopyright © 2017–2021 SNF4J.ORG. All rights reserved.