tcp ingress connector

TCP Ingress Connector

Version: 17.07

Supported Since: 17.07

What is a TCP Ingress Connector?

A TCP Ingress Connector is an abstract ingress connector, which can be used to implement custom ingress connectors for TCP based protocols with a minimum amount of custom coding.

Writing a custom TCP connector

This section walks you through the steps you need to follow when writing a custom TCP ingress connector.

Writing the transport components

To implement a basic custom TCP ingress connector, concrete implementations of following classes are mandatory.

  • AbstractTCPServerIOEventDispatcher

  • AbstractTCPListener

AbstractTCPServerIOEventDispatcher

This class is used to notify I/O events pending for a particular TCP session. All methods of this class are executed on a dispatch thread of the underlying implementation. Following methods should be implemented by a concrete implementation of AbstractTCPClientIOEventDispatcher. All the methods receive a TCPSession instance as a parameter.

Method

Description

onConnected

Triggers after the TCP session has just been created

onInputReady

Triggers when the TCP session has an input pending

onOutputReady

Triggers when the TCP session has an output pending

onTimeout

Triggers when the TCP session has timed out

onDisconnected

Triggers when the TCP session has disconnected

AbstractTCPListener

This class holds the information that defines the complete functionality of a transport listener. Only a single method should be implemented in the concrete implementation of AbstractTCPListener.

Method

Description

getNewIOEventDispatcher

Creates a new I/O event dispatcher instance of a concrete implementation of AbstractTCPServerIOEventDispatcher and returns it

Writing the connector

Custom TCP ingress connector should be a concrete implementation of AbstractTCPIngressConnector or AbstractTCPResponseIngressConnector based on the requirement of the protocol.

In this topic
In this topic
Contact Us