Connects to remote IPs and manages socket connections.
This method establishes connections to remote IPs for media streaming, handles new pipe producer events,
and manages producer closure events. It updates the necessary state in the application to reflect
the current connections and stream configurations.
Param: options
The options for connecting IPs.
Param: options.consume_sockets
The array of current socket connections.
Param: options.remIP
The list of remote IPs to connect to.
Param: options.apiUserName
The API username for authentication.
Param: options.apiKey
The API key for authentication.
Param: options.apiToken
The API token for authentication.
Param: options.newProducerMethod
The method to handle new pipe producer events (default: newPipeProducer).
Param: options.closedProducerMethod
The method to handle producer closed events (default: producerClosed).
Param: options.joinConsumeRoomMethod
The method to handle joining a consuming room (default: joinConsumeRoom).
Param: options.parameters
Additional parameters for the operation.
Param: options.parameters.roomRecvIPs
The list of IPs that have been received in the room.
Param: options.parameters.updateRoomRecvIPs
Function to update the room received IPs.
Param: options.parameters.updateConsume_sockets
Function to update the consume sockets.
Returns
A promise that resolves to an array containing the updated consume sockets and room received IPs.
Throws
Will throw an error if required parameters are missing or if there is an issue connecting to a remote IP.
Connects to remote IPs and manages socket connections.
This method establishes connections to remote IPs for media streaming, handles new pipe producer events, and manages producer closure events. It updates the necessary state in the application to reflect the current connections and stream configurations.
Param: options
The options for connecting IPs.
Param: options.consume_sockets
The array of current socket connections.
Param: options.remIP
The list of remote IPs to connect to.
Param: options.apiUserName
The API username for authentication.
Param: options.apiKey
The API key for authentication.
Param: options.apiToken
The API token for authentication.
Param: options.newProducerMethod
The method to handle new pipe producer events (default: newPipeProducer).
Param: options.closedProducerMethod
The method to handle producer closed events (default: producerClosed).
Param: options.joinConsumeRoomMethod
The method to handle joining a consuming room (default: joinConsumeRoom).
Param: options.parameters
Additional parameters for the operation.
Param: options.parameters.roomRecvIPs
The list of IPs that have been received in the room.
Param: options.parameters.updateRoomRecvIPs
Function to update the room received IPs.
Param: options.parameters.updateConsume_sockets
Function to update the consume sockets.
Returns
A promise that resolves to an array containing the updated consume sockets and room received IPs.
Throws
Will throw an error if required parameters are missing or if there is an issue connecting to a remote IP.
Example