public class GridTcpNioCommunicationClient extends GridAbstractCommunicationClient
metricsLsnr
Constructor and Description |
---|
GridTcpNioCommunicationClient(int connIdx,
GridNioSession ses,
IgniteLogger log) |
Modifier and Type | Method and Description |
---|---|
boolean |
async() |
boolean |
close() |
void |
doHandshake(IgniteInClosure2X<InputStream,OutputStream> handshakeC)
Executes the given handshake closure on opened client passing underlying IO streams.
|
void |
forceClose()
Forces client close.
|
long |
getIdleTime()
Gets idle time of this client.
|
void |
sendMessage(byte[] data,
int len) |
void |
sendMessage(ByteBuffer data) |
boolean |
sendMessage(UUID nodeId,
Message msg,
IgniteInClosure<IgniteException> c) |
GridNioSession |
session() |
String |
toString() |
closed, connectionIndex, markUsed, release, reserve
public GridTcpNioCommunicationClient(int connIdx, GridNioSession ses, IgniteLogger log)
connIdx
- Connection index.ses
- Session.log
- Logger.public GridNioSession session()
public void doHandshake(IgniteInClosure2X<InputStream,OutputStream> handshakeC) throws IgniteCheckedException
handshakeC
- Handshake.IgniteCheckedException
- If handshake failed.public boolean close()
close
in interface GridCommunicationClient
close
in class GridAbstractCommunicationClient
True
if client has been closed by this call,
false
if failed to close client (due to concurrent reservation or concurrent close).public void forceClose()
forceClose
in interface GridCommunicationClient
forceClose
in class GridAbstractCommunicationClient
public void sendMessage(byte[] data, int len) throws IgniteCheckedException
data
- Data to send.len
- Length.IgniteCheckedException
- If failed.public void sendMessage(ByteBuffer data) throws IgniteCheckedException
data
- Data to send.IgniteCheckedException
- If failed.public boolean sendMessage(@Nullable UUID nodeId, Message msg, IgniteInClosure<IgniteException> c) throws IgniteCheckedException
nodeId
- Remote node ID. Provided only for sync clients.msg
- Message to send.c
- Ack closure.True
if should try to resend message.IgniteCheckedException
- If failed.public boolean async()
async
in interface GridCommunicationClient
async
in class GridAbstractCommunicationClient
True
if send is asynchronous.public long getIdleTime()
getIdleTime
in interface GridCommunicationClient
getIdleTime
in class GridAbstractCommunicationClient
public String toString()
toString
in class GridAbstractCommunicationClient
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017