Channel Class
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.
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
ObjectThe message to be sent
Events
closed
()
The connection was closed
error
(
-
error
An error occured with the underlying connection.
Parameters:
-
error
ErrorThe error which occured
message
(
-
data
A message was received. You might have to decode the data.
Parameters:
-
data
ObjectThe decoded message