Facilitates joining a room by emitting the joinRoom event to the server through a socket connection.
joinRoom
Configuration options for joining the room.
The socket instance for server communication.
The name of the room to join.
Level identifier for the user in the room.
Member identifier for the joining user.
Security token or identifier for access.
API username for server authentication.
If true, joins via joinConRoom; otherwise, joins via joinRoom.
true
joinConRoom
const joinRoomClient = new JoinRoomClient(joinRoomService, joinConRoomService);const response = await joinRoomClient.joinRoomClient({ socket: mySocket, roomName: 'myRoom', islevel: '1', member: 'user123', sec: 'secureToken', apiUserName: 'apiUser', consume: true,});console.log('Joined room with response:', response); Copy
const joinRoomClient = new JoinRoomClient(joinRoomService, joinConRoomService);const response = await joinRoomClient.joinRoomClient({ socket: mySocket, roomName: 'myRoom', islevel: '1', member: 'user123', sec: 'secureToken', apiUserName: 'apiUser', consume: true,});console.log('Joined room with response:', response);
This example demonstrates using joinRoomClient to join a room, either as a consumer or a producer, based on the consume flag.
joinRoomClient
consume
Joins a room by emitting the joinRoom event to the server using the provided socket.
The options for joining the room.
A promise that resolves with the data returned from the server.
Throws an error if the room joining process fails.
Facilitates joining a room by emitting the
joinRoom
event to the server through a socket connection.Param: options
Configuration options for joining the room.
Param: options.socket
The socket instance for server communication.
Param: options.roomName
The name of the room to join.
Param: options.islevel
Level identifier for the user in the room.
Param: options.member
Member identifier for the joining user.
Param: options.sec
Security token or identifier for access.
Param: options.apiUserName
API username for server authentication.
Param: options.consume
If
true
, joins viajoinConRoom
; otherwise, joins viajoinRoom
.Returns
Throws
Example
This example demonstrates using
joinRoomClient
to join a room, either as a consumer or a producer, based on theconsume
flag.