@epicgames-ps/lib-pixelstreamingcommon-ue5.5 / Protocol/SignallingProtocol / SignallingProtocol
Protocol/SignallingProtocol.SignallingProtocol
Signalling protocol for handling messages from the signalling server.
Listen on this emitter for messages. Message type is the name of the event to listen for.
Example:
signallingProtocol.on('config', (message: Messages.config) => console.log(Got a config message: ${message}
)));
The transport in this class will also emit on message events.
Events emitted on transport:
message:
Emitted any time a message is received by the transport. Listen on this if
you wish to capture all messages, rather than specific messages on
'messageHandlers'.
out:
Emitted when sending a message out on the transport. Similar to 'message' but
only for when messages are sent from this endpoint. Useful for debugging.
-
EventEmitter
↳
SignallingProtocol
• new SignallingProtocol(transport
): SignallingProtocol
Name | Type |
---|---|
transport |
ITransport |
EventEmitter.constructor
Protocol/SignallingProtocol.ts:34
• transport: ITransport
Protocol/SignallingProtocol.ts:32
• get
SIGNALLING_VERSION(): string
string
Protocol/SignallingProtocol.ts:29
▸ connect(url
): boolean
Asks the transport to connect to the given URL.
Name | Type | Description |
---|---|---|
url |
string |
The url to connect to. |
boolean
True if the connection call succeeded.
Protocol/SignallingProtocol.ts:56
▸ disconnect(code?
, reason?
): void
Asks the transport to disconnect from any connection it might have.
Name | Type | Description |
---|---|---|
code? |
number |
An optional disconnection code. |
reason? |
string |
An optional descriptive string for the disconnect reason. |
void
Protocol/SignallingProtocol.ts:65
▸ isConnected(): boolean
Returns true if the transport is connected and ready to send/receive messages.
boolean
True if the protocol is connected.
Protocol/SignallingProtocol.ts:73
▸ sendMessage(msg
): void
Passes a message to the transport to send to the other end.
Name | Type | Description |
---|---|---|
msg |
BaseMessage |
The message to send. |
void