org.apache.ignite.internal.util.nio

## Interface GridNioServerListener<T>

All Known Implementing Classes:
  GridNioServerListenerAdapter, GridTcpMemcachedNioListener, GridTcpRestNioListener, GridTcpRouterNioListenerAdapter

    public interface GridNioServerListener<T>

Listener passed in to the `GridNioServer` that will be notified on client events.

### Method Summary

Methods
`void` `onConnected(GridNioSession ses)` This method is called whenever a new client is connected and session is created.
`void` `onDisconnected(GridNioSession ses, Exception e)` This method is called whenever client is disconnected due to correct connection close or due to `IOException` during network operations.
`void` `onMessage(GridNioSession ses, T msg)` This method is called whenever a `GridNioParser` returns non-null value.
`void` `onSessionIdleTimeout(GridNioSession ses)` Called when session did not receive any activity within timeout interval.
`void` `onSessionWriteTimeout(GridNioSession ses)` Called when session has non-empty write queue and server did not send any data within timeout interval.

### Method Detail

#### onConnected

    void onConnected(GridNioSession ses)

This method is called whenever a new client is connected and session is created.

Parameters:
  `ses` - Newly created session for remote client.

#### onDisconnected

    void onDisconnected(GridNioSession ses,
                      @Nullable
                      Exception e)

This method is called whenever client is disconnected due to correct connection close or due to `IOException` during network operations.

Parameters:
  `ses` - Closed session.
  `e` - Exception occurred, if any.

#### onMessage

    void onMessage(GridNioSession ses,
                 T msg)

This method is called whenever a `GridNioParser` returns non-null value.

Parameters:
  `ses` - Session on which message was received.
  `msg` - Parsed message.

#### onSessionWriteTimeout

    void onSessionWriteTimeout(GridNioSession ses)

Called when session has non-empty write queue and server did not send any data within timeout interval.

Parameters:
  `ses` - Session that has timed out writes.

#### onSessionIdleTimeout

    void onSessionIdleTimeout(GridNioSession ses)

Called when session did not receive any activity within timeout interval.

Parameters:
  `ses` - Session that is idle.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC3
Release Date | : March 24 2015