API Docs for:
Show:

Channel Class

Extends events.EventEmitter
Module: easy-signaling

Concept of a channel connecting the client to the signaling server. This is not an actual class but the description of the interface used to represent the communication channels. For a reference implementation look at WebsocketChannel.

The interface expects JavaScript Objects to come in and out of the API. You most propably want to encode the messages on the transport channel, for example using JSON.

Item Index

Methods

Methods

close

()

Close the connection to the client

send

(
  • data
)

Send data to the client. You might have to encode the data for transmission.

Parameters:

  • data Object

    The message to be sent

Events

closed

()

The connection was closed

error

(
  • error
)

An error occured with the underlying connection.

Parameters:

  • error Error

    The error which occured

message

(
  • data
)

A message was received. You might have to decode the data.

Parameters:

  • data Object

    The decoded message