Class: AttachableDuplexOutputChannelBase

AttachableDuplexOutputChannelBase

(abstract) new AttachableDuplexOutputChannelBase()

Base class for communication components which need a capability to attach duplex output channel. This is meant to be abstract class. Therefore do not instantiate it directly.
Source:

Methods

_onResponseMessageReceived()

The event is invoked when the response message is received. This event handler method is supposed to be overridden by derived classes.
Source:

attachDuplexOutputChannel(outputChannel)

Attaches the duplex output channel and opens the connection for sending request messages and receiving response messages.
Please notice when the call returns from this method the connection does not have to be open yet. It can be still in the state opening. Use onConnectionOpened eent to detect when the connetion is open.
Parameters:
Name Type Description
outputChannel WebSocketDuplexOutputChannel
Source:
Throws:
Throws an error if attaching fails.

detachDuplexOutputChannel()

Detaches the duplex output channel and stops listening to response messages.
Source:

getAttachedDuplexOutputChannel()

Returns attached duplex output channel.
Source:

isDuplexOutputChannelAttached()

Returns true if the duplex output channel is attached.
Please notice when the channel is attached it does not have to be connected. E.g. once the output channel was attached and the connection was open and then the connection was broken or closed by input channel.
Source:

onConnectionClosed()

The event which can be subscribed to receive the notification when the connection was closed.
Source:
Example
// Set your handler to receive close connection notification.
aSender.onConnectionClosed = yourOnConnectionClosed;

onConnectionOpened()

The event which can be subscribed to receive the notification when the connection is open.
Source:
Example
// Set your handler to receive open connection notification. 
aSender.onConnectionOpened = yourOnConnectionOpened;