org.apache.ignite.internal.util.nio

## Interface GridCommunicationClient

All Known Implementing Classes:
  GridAbstractCommunicationClient, GridTcpNioCommunicationClient

    public interface GridCommunicationClient

### Method Summary

All Methods Instance Methods Abstract Methods
`boolean` `async()`
`boolean` `close()`
`boolean` `closed()`
`int` `connectionIndex()`
`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` `release()` Releases this client by decreasing reservations.
`boolean` `reserve()`
`void` `sendMessage(byte[] data, int len)`
`void` `sendMessage(ByteBuffer data)`
`boolean` `sendMessage(@Nullable UUID nodeId, Message msg, @Nullable IgniteInClosure<IgniteException> c)`

### Method Detail

#### doHandshake

    void doHandshake(IgniteInClosure2X<InputStream,OutputStream> handshakeC)
              throws IgniteCheckedException

Executes the given handshake closure on opened client passing underlying IO streams. This method pulled to client interface a handshake is only operation requiring access to both output and input streams.

Parameters:
  `handshakeC` - Handshake.
Throws:
  `IgniteCheckedException` - If handshake failed.

#### close

    boolean close()

Returns:
  `True` if client has been closed by this call, `false` if failed to close client (due to concurrent reservation or concurrent close).

#### forceClose

    void forceClose()

Forces client close.

#### closed

    boolean closed()

Returns:
  `True` if client is closed;

#### reserve

    boolean reserve()

Returns:
  `True` if client was reserved, `false` otherwise.

#### release

    void release()

Releases this client by decreasing reservations.

#### getIdleTime

    long getIdleTime()

Gets idle time of this client.

Returns:
  Idle time of this client.

#### sendMessage

    void sendMessage(ByteBuffer data)
              throws IgniteCheckedException

Parameters:
  `data` - Data to send.
Throws:
  `IgniteCheckedException` - If failed.

#### sendMessage

    void sendMessage(byte[] data,
                     int len)
              throws IgniteCheckedException

Parameters:
  `data` - Data to send.
  `len` - Length.
Throws:
  `IgniteCheckedException` - If failed.

#### sendMessage

    boolean sendMessage(@Nullable
                        @Nullable UUID nodeId,
                        Message msg,
                        @Nullable
                        @Nullable IgniteInClosure<IgniteException> c)
                 throws IgniteCheckedException

Parameters:
  `nodeId` - Remote node ID. Provided only for sync clients.
  `msg` - Message to send.
  `c` - Ack closure.
Returns:
  `True` if should try to resend message.
Throws:
  `IgniteCheckedException` - If failed.

#### async

    boolean async()

Returns:
  `True` if send is asynchronous.

#### connectionIndex

    int connectionIndex()

Returns:
  Connection index.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022