Session

Session

Represents a host session.

Mixes in EventEmitter for event listening.

Members

ConnectionState

Properties:
Name Type Description
ConnectionState.CONNECTING String

'connecting'

ConnectionState.CONNECTED String

'connected'

ConnectionState.DISCONNECTING String

'disconnecting'

ConnectionState.DISCONNECTED String

'disconnected'

Methods

connect()

Connect the host session. Event.CONNECTION_STATE_CHANGED will be fired as the connection state changes.

disconnect()

Disconnect the host session. Event.CONNECTION_STATE_CHANGED will be fired as the connection state changes.

isConnected() → {Boolean}

Determines if the session is connected to the host.

Returns:

true if host connection is established.

Type
Boolean

getConnectionState() → {Session#ConnectionState}

Gets the state of the host connection for the session.

Returns:
Type
Session#ConnectionState

getType() → {String}

Gets the host session type.

Returns:
Type
String

getName() → {String}

Gets the session name.

Returns:
Type
String

getId() → {String}

Gets the session instance id.

Returns:
Type
String

getDeviceName() → {String}

Returns the device name for a connected session or an empty string if the session is disconnected or doesn't have a device name.

Returns:

The connected device name.

Type
String

setDeviceName(name)

Provides a means to modify the device name on a session instance. The device name must be set before the session is connected to the host.

Parameters:
Name Type Description
name String

Device name to use when connecting to a host.

Throws:

If an attempt is made to set the device name while the session is connected.

Type
Error

getPresentationSpace() → {PresentationSpace}

Gets the PresentationSpace.

Returns:
Type
PresentationSpace

getOIA() → {OIA}

Gets the OIA or status line

Returns:
Type
OIA

Events

Event.CONNECTION_STATE_CHANGED

Fired when the session's connection state to the host changes.

Parameters:
Name Type Description
event Object
Properties
Name Type Description
source Session

the Session object that fired the event

connectionState Session#ConnectionState

the new connection state

Event.ERROR

Fired if there's an error with the session.

Parameters:
Name Type Description
event Object
Properties
Name Type Description
source Session

the Session object that fired the event

error Error

the error