Skip to content

Fix lint errors #954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions lib/services/ios-debug-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class IOSDebugService implements IDebugService {
}).future<void>()()).wait();
}).future<void>()();
}

private wireDebuggerClient(factory: () => net.Socket): IFuture<void> {
return (() => {
let frameworkVersion = this.getProjectFrameworkVersion().wait();
Expand All @@ -237,7 +237,7 @@ class IOSDebugService implements IDebugService {

private openDebuggingClient(fileDescriptor: string): IFuture<void> {
return (() => {
let frameworkVersion = this.getProjectFrameworkVersion().wait();
let frameworkVersion = this.getProjectFrameworkVersion().wait();
let inspectorPath = this.getInspectorPath(frameworkVersion).wait();
let inspectorSourceLocation = path.join(inspectorPath, "Safari/Main.html");
let cmd: string = null;
Expand All @@ -255,7 +255,7 @@ class IOSDebugService implements IDebugService {
this.$childProcess.exec(cmd).wait();
}).future<void>()();
}

private getProjectFrameworkVersion(): IFuture<string> {
return (() => {
this.$projectDataService.initialize(this.$projectData.projectDir);
Expand Down Expand Up @@ -292,39 +292,39 @@ $injector.register("iOSDebugService", IOSDebugService);

function createTcpSocketProxy($logger: ILogger, socketFactory: (handler: (socket: net.Socket) => void) => void): string {
$logger.info("\nSetting up debugger proxy...\nPress Ctrl + C to terminate, or disconnect.\n");

let server = net.createServer({
allowHalfOpen: true
});

server.on("connection", (frontendSocket: net.Socket) => {
$logger.info("Frontend client connected.");

frontendSocket.on("end", function() {
$logger.info('Frontend socket closed!');
process.exit(0);
});
});

socketFactory((backendSocket) => {
$logger.info("Backend socket created.");

backendSocket.on("end", () => {
$logger.info("Backend socket closed!");
process.exit(0);
});

backendSocket.pipe(frontendSocket);
frontendSocket.pipe(backendSocket);
frontendSocket.resume();
});
});
});

let socketFileLocation = temp.path({ suffix: ".sock" });
server.listen(socketFileLocation);

return socketFileLocation;
}

function createWebSocketProxy($logger: ILogger, socketFactory: (handler: (socket: net.Socket) => void) => void): ws.Server {
// NOTE: We will try to provide command line options to select ports, at least on the localhost.
let localPort = 8080;
Expand All @@ -340,9 +340,9 @@ function createWebSocketProxy($logger: ILogger, socketFactory: (handler: (socket
port: localPort,
verifyClient: (info: any, callback: any) => {
$logger.info("Frontend client connected.");
socketFactory((socket) => {
socketFactory((_socket: any) => {
$logger.info("Backend socket created.");
info.req["__deviceSocket"] = socket;
info.req["__deviceSocket"] = _socket;
callback(true);
});
}
Expand Down