@epicgames-ps/lib-pixelstreamingcommon-ue5.5 / Transport/WebSocketTransport / WebSocketTransport
Transport/WebSocketTransport.WebSocketTransport
The controller for the WebSocket and all associated methods
-
EventEmitter
↳
WebSocketTransport
- connect
- disconnect
- handleOnClose
- handleOnError
- handleOnMessage
- handleOnMessageBinary
- handleOnOpen
- isConnected
- sendMessage
• new WebSocketTransport(): WebSocketTransport
EventEmitter.constructor
Transport/WebSocketTransport.ts:22
• WS_OPEN_STATE: number
= 1
Transport/WebSocketTransport.ts:19
• Optional
onMessage: (msg
: BaseMessage
) => void
Callback filled in by the SignallingProtocol and should be called by the transport when a new message arrives.
▸ (msg
): void
Name | Type |
---|---|
msg |
BaseMessage |
void
Transport/WebSocketTransport.ts:37
• Optional
webSocket: WebSocket
Transport/WebSocketTransport.ts:20
▸ connect(connectionURL
): boolean
Connect to the signaling server
Name | Type | Description |
---|---|---|
connectionURL |
string |
The Address of the signaling server |
boolean
If there is a connection
Transport/WebSocketTransport.ts:44
▸ disconnect(code?
, reason?
): void
Disconnect this transport.
Name | Type | Description |
---|---|---|
code? |
number |
An optional disconnect code. |
reason? |
string |
A descriptive string for the disconnect reason. |
void
Transport/WebSocketTransport.ts:65
▸ handleOnClose(event
): void
Handles when the Websocket is closed
Name | Type | Description |
---|---|---|
event |
CloseEvent |
Close Event |
void
Transport/WebSocketTransport.ts:171
▸ handleOnError(): void
Handles when there is an error on the websocket
void
Transport/WebSocketTransport.ts:162
▸ handleOnMessage(event
): void
Handles what happens when a message is received
Name | Type | Description |
---|---|---|
event |
MessageEvent <any > |
Message Received |
void
Transport/WebSocketTransport.ts:116
▸ handleOnMessageBinary(event
): void
Handles what happens when a message is received in binary form
Name | Type | Description |
---|---|---|
event |
MessageEvent <Blob > |
Message Received |
void
Transport/WebSocketTransport.ts:83
▸ handleOnOpen(): void
Handles when the Websocket is opened
void
Transport/WebSocketTransport.ts:150
▸ isConnected(): boolean
Should return true when the transport is connected and ready to send/receive messages.
boolean
True if the transport is connected.
Transport/WebSocketTransport.ts:75
▸ sendMessage(msg
): void
Sends a message over the websocket.
Name | Type | Description |
---|---|---|
msg |
BaseMessage |
The message to send. |
void