Skip to content

Latest commit

 

History

History
198 lines (110 loc) · 5.69 KB

File metadata and controls

198 lines (110 loc) · 5.69 KB

@epicgames-ps/lib-pixelstreamingsignalling-ue5.5 / PlayerConnection / PlayerConnection

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

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

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.

Parameters

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.

Returns

PlayerConnection

Defined in

PlayerConnection.ts:50

Properties

playerId

playerId: string

Implementation of

IPlayer.playerId

Defined in

PlayerConnection.ts:27


protocol

protocol: SignallingProtocol

Implementation of

IPlayer.protocol

Defined in

PlayerConnection.ts:31


remoteAddress

Optional remoteAddress: string

Defined in

PlayerConnection.ts:35


subscribedStreamer

subscribedStreamer: null | IStreamer

Implementation of

IPlayer.subscribedStreamer

Defined in

PlayerConnection.ts:33


transport

transport: ITransport

Defined in

PlayerConnection.ts:29

Methods

getPlayerInfo

getPlayerInfo(): IPlayerInfo

Returns a descriptive object for the REST API inspection operations.

Returns

IPlayerInfo

An IPlayerInfo object containing viewable information about this connection.

Implementation of

IPlayer.getPlayerInfo

Defined in

PlayerConnection.ts:87


getReadableIdentifier

getReadableIdentifier(): string

Returns an identifier that is displayed in logs.

Returns

string

A string describing this connection.

Implementation of

IMessageLogger.getReadableIdentifier

Defined in

PlayerConnection.ts:72


sendMessage

sendMessage(message): void

Sends a signalling message to the player.

Parameters

Name Type Description
message BaseMessage The message to send.

Returns

void

Implementation of

IPlayer.sendMessage

Defined in

PlayerConnection.ts:78