Skip to content

Latest commit

 

History

History
185 lines (103 loc) · 4.7 KB

Protocol_SignallingProtocol.SignallingProtocol.md

File metadata and controls

185 lines (103 loc) · 4.7 KB

@epicgames-ps/lib-pixelstreamingcommon-ue5.5 / Protocol/SignallingProtocol / SignallingProtocol

Class: 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.

Hierarchy

  • EventEmitter

    SignallingProtocol

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new SignallingProtocol(transport): SignallingProtocol

Parameters

Name Type
transport ITransport

Returns

SignallingProtocol

Overrides

EventEmitter.constructor

Defined in

Protocol/SignallingProtocol.ts:34

Properties

transport

transport: ITransport

Defined in

Protocol/SignallingProtocol.ts:32

Accessors

SIGNALLING_VERSION

get SIGNALLING_VERSION(): string

Returns

string

Defined in

Protocol/SignallingProtocol.ts:29

Methods

connect

connect(url): boolean

Asks the transport to connect to the given URL.

Parameters

Name Type Description
url string The url to connect to.

Returns

boolean

True if the connection call succeeded.

Defined in

Protocol/SignallingProtocol.ts:56


disconnect

disconnect(code?, reason?): void

Asks the transport to disconnect from any connection it might have.

Parameters

Name Type Description
code? number An optional disconnection code.
reason? string An optional descriptive string for the disconnect reason.

Returns

void

Defined in

Protocol/SignallingProtocol.ts:65


isConnected

isConnected(): boolean

Returns true if the transport is connected and ready to send/receive messages.

Returns

boolean

True if the protocol is connected.

Defined in

Protocol/SignallingProtocol.ts:73


sendMessage

sendMessage(msg): void

Passes a message to the transport to send to the other end.

Parameters

Name Type Description
msg BaseMessage The message to send.

Returns

void

Defined in

Protocol/SignallingProtocol.ts:81