Class: SocketEventHandler
Defined in: socket/index.ts:33
Class to handle Socket Events such as connecting and disconnecting from rooms.
Extended by
Constructors
Constructor
new SocketEventHandler(
room,
eventName,
source,
payload,
memberSocket): SocketEventHandler;
Defined in: socket/index.ts:59
Parameters
| Parameter | Type | Description |
|---|---|---|
room | Room | The Room where the event is happening |
eventName | string | The name of the event |
source | User | The User associated with the event |
payload | IKeyValue | The input values of the event |
memberSocket | string | The member socketID to send event to (may be null) |
Returns
SocketEventHandler
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
eventName | protected | string | The event name of a socket event | socket/index.ts:35 |
input | protected | IKeyValue | The input of the socket event | socket/index.ts:41 |
memberSocket | protected | string | MemberSocket ID | socket/index.ts:50 |
output | protected | SocketIOContextOutput | The output of the socket event | socket/index.ts:38 |
room | protected | Room | The room where the event is occurring | socket/index.ts:44 |
source | protected | User | The user associated with the event | socket/index.ts:47 |
Methods
isSDPEvent()
protected isSDPEvent(): boolean;
Defined in: socket/index.ts:110
Checks the Event Name for sdp events
Returns
boolean
room:event or the SDP event Name
parametersReturn()
protected parametersReturn(): IKeyValue;
Defined in: socket/index.ts:120
Returns the parameters for the broadcast event, with special consideration for SDP events
Returns
IKeyValue
broadcast parameters
passthru()
protected passthru(): Promise<void>;
Defined in: socket/index.ts:77
Event to Trigger a sendToRooms event.
Returns
Promise<void>
process()
protected process(): Promise<void>;
Defined in: socket/index.ts:96
A method to process data/information. Should be overridden in subclasses.
Returns
Promise<void>
result()
result(): Promise<SocketIOContextOutput>;
Defined in: socket/index.ts:101
The output produced from this.process
Returns
Promise<SocketIOContextOutput>