MediaSFU React Native
    Preparing search index...

    Function connectIps

    • Connects to remote IPs and manages socket connections.

      Parameters

      Returns Promise<[Record<string, any>[], string[]]>

      A promise that resolves to an array containing the updated consume sockets and room received IPs.

      Will throw an error if required parameters are missing or if there is an issue connecting to a remote IP.

      const options = {
      consume_sockets: [],
      remIP: ['ip1', 'ip2'],
      apiUserName: 'username',
      apiKey: 'apikey',
      apiToken: 'token',
      parameters: {
      roomRecvIPs: [],
      updateRoomRecvIPs: updateRoomRecvIPsFunction,
      updateConsume_sockets: updateConsumeSocketsFunction,
      },
      };

      connectIps(options)
      .then(([consume_sockets, roomRecvIPs]) => {
      console.log('Connected IPs:', consume_sockets);
      console.log('Room received IPs:', roomRecvIPs);
      });