@epicgames-ps/lib-pixelstreamingcommon-ue5.5 / Transport/ITransport / ITransport
Transport/ITransport.ITransport
An interface to a transport protocol that is in charge of sending and receiving signalling messages. Implement this interface to support your custom transport. You can then supply an instance of your transport to the constructor of SignallingProtocol during startup.
-
EventEmitter
↳
ITransport
• 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
Callback filled in by the SignallingProtocol and should be called by the transport when a new message arrives.
Name | Type |
---|---|
msg |
BaseMessage |
void
▸ connect(url
): boolean
Connect to a given URL.
Name | Type | Description |
---|---|---|
url |
string |
The URL for the transport to connect to. |
boolean
True if the connection was successful.
▸ 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
▸ isConnected(): boolean
Should return true when the transport is connected and ready to send/receive messages.
boolean
True if the transport is connected.
▸ sendMessage(msg
): void
Called when the protocol wants to send a message over the transport.
Name | Type | Description |
---|---|---|
msg |
BaseMessage |
The message to send over the transport. |
void