How to use the appium-ios-device.utilities.connectPort function in appium-ios-device

To help you get started, we’ve selected a few appium-ios-device examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appium / appium-xcuitest-driver / lib / device-connections-factory.js View on Github external
this.serverSocket = net.createServer(async (localSocket) => {
      try {
        const remoteSocket = await utilities.connectPort(this.udid, this.deviceport);
        remoteSocket.on('close', () => localSocket.end());
        remoteSocket.on('error', (e) => {
          // not all remote socket errors are critical for the user
          this.log.info(e.message);
          this.log.debug(e);
        });
        localSocket.on('close', () => remoteSocket.end());
        localSocket.on('error', (e) => this.log.warn(e.message));
        localSocket.pipe(remoteSocket);
        remoteSocket.pipe(localSocket);
      } catch (e) {
        this.log.error(e);
        localSocket.end();
      }
    });
    const status = new B((resolve, reject) => {
github appium / appium-xcuitest-driver / lib / wda / iproxy.js View on Github external
this.serverSocket = net.createServer(async (connection) => {
      try {
        const socket = await utilities.connectPort(this.udid, this.deviceport);
        socket.on('close', connection.destroy);
        socket.on('error', log.error);
        connection.on('close', socket.destroy);
        connection.on('error', log.error);
        connection.pipe(socket);
        socket.pipe(connection);
      } catch (e) {
        log.warn(e.message);
        connection.destroy();
      }
    });
    const status = new B((resolve, reject) => {