@epicgames-ps/lib-pixelstreamingsignalling-ue5.5 / PlayerConnection / PlayerConnection
PlayerConnection.PlayerConnection
A connection between the signalling server and a player connection. This is where messages expected to be handled by the player come in and where messages are sent to the player.
Interesting internals: playerId: The unique id string of this player. transport: The ITransport where transport events can be subscribed to protocol: The SignallingProtocol where signalling messages can be subscribed to.
• new PlayerConnection(server, ws, sendOffer, remoteAddress?): PlayerConnection
Initializes a new connection with given and sane values. Adds listeners for the websocket close and error so it can react by unsubscribing and resetting itself.
| Name | Type | Description |
|---|---|---|
server |
SignallingServer |
The signalling server object that spawned this player. |
ws |
WebSocket |
The websocket coupled to this player connection. |
sendOffer |
boolean |
True if the player is requesting to receive offers from streamers. |
remoteAddress? |
string |
The remote address of this connection. Only used as display. |
• playerId: string
• protocol: SignallingProtocol
• Optional remoteAddress: string
• subscribedStreamer: null | IStreamer
• transport: ITransport
▸ getPlayerInfo(): IPlayerInfo
Returns a descriptive object for the REST API inspection operations.
An IPlayerInfo object containing viewable information about this connection.
▸ getReadableIdentifier(): string
Returns an identifier that is displayed in logs.
string
A string describing this connection.
IMessageLogger.getReadableIdentifier
▸ sendMessage(message): void
Sends a signalling message to the player.
| Name | Type | Description |
|---|---|---|
message |
BaseMessage |
The message to send. |
void