Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.socket.connect(this.port, this.host);
}
this.socket.setNoDelay(true);
this.socket.setKeepAlive(true);
this.socket.on('close', () => {
if (this.connected) {
log.debug('Debugger socket disconnected');
}
this.connected = false;
this.socket = null;
});
this.socket.on('end', () => {
this.connected = false;
});
this.service = await services.startWebInspectorService(this.udid, {
socket: this.socket,
isSimulator: true,
osVersion: this.platformVersion,
verbose: this.logAllCommunication,
verboseHexDump: this.logAllCommunicationHexDump,
});
this.service.listenMessage(this.receive.bind(this));
// connect the socket
return await new B((resolve, reject) => {
// only resolve this function when we are actually connected
this.socket.on('connect', () => {
log.debug(`Debugger socket connected`);
this.connected = true;
resolve();
async connect () {
this.service = await services.startWebInspectorService(this.udid, {
osVersion: this.platformVersion,
isSimulator: false,
verbose: this.logAllCommunication,
verboseHexDump: this.logAllCommunicationHexDump,
socketChunkSize: this.socketChunkSize,
});
this.service.listenMessage(this.receive.bind(this));
this.connected = true;
}