From e8a18fc863c9b8a608aeac5f6b42ad6bbcb72504 Mon Sep 17 00:00:00 2001 From: Martin Bektchiev Date: Fri, 25 May 2018 10:54:06 +0300 Subject: [PATCH] fix(debugging): Change default debugging port to 18183 It turned out that 18182 is used by {N} CLI. It is specified as the port to listen when launching adb server. This lead to a mysterious bug when both android and ios devices were connected. To avoid it for users with previous CLIs we'll change it to 18183. For more details see: https://github.com/NativeScript/nativescript-cli/pull/3614 --- .../Inspector/Inspector/NativeScript Inspector/Communication.m | 2 +- src/debugging/TNSDebugging.h | 2 +- src/debugging/debugger-proxy.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debugging/Inspector/Inspector/NativeScript Inspector/Communication.m b/src/debugging/Inspector/Inspector/NativeScript Inspector/Communication.m index 32b07f4ba..fb38a2a51 100644 --- a/src/debugging/Inspector/Inspector/NativeScript Inspector/Communication.m +++ b/src/debugging/Inspector/Inspector/NativeScript Inspector/Communication.m @@ -108,7 +108,7 @@ - (instancetype)initWithSocketPath:(NSString*)socketPath readHandler:(InspectorR communicationSocket = socket(PF_INET, SOCK_STREAM, 0); struct sockaddr_in addr = { - sizeof(addr), AF_INET, htons(18182), { INADDR_ANY }, { 0 } + sizeof(addr), AF_INET, htons(18183), { INADDR_ANY }, { 0 } }; connected = setupConnection((const struct sockaddr*)&addr, sizeof(addr)); diff --git a/src/debugging/TNSDebugging.h b/src/debugging/TNSDebugging.h index 31737eb47..4de6408a7 100644 --- a/src/debugging/TNSDebugging.h +++ b/src/debugging/TNSDebugging.h @@ -79,7 +79,7 @@ TNSCreateInspectorServer(TNSInspectorFrontendConnectedHandler connectedHandler, setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, &so_reuseaddr, sizeof(so_reuseaddr)); struct sockaddr_in addr = { - sizeof(addr), AF_INET, htons(18182), { INADDR_ANY }, { 0 } + sizeof(addr), AF_INET, htons(18183), { INADDR_ANY }, { 0 } }; if (bind(listenSocket, (const struct sockaddr*)&addr, sizeof(addr)) != 0) { diff --git a/src/debugging/debugger-proxy.js b/src/debugging/debugger-proxy.js index 69bcc378c..a5a06f692 100644 --- a/src/debugging/debugger-proxy.js +++ b/src/debugging/debugger-proxy.js @@ -37,7 +37,7 @@ var server = ws.createServer({ server.on("connection", function(webSocket) { console.info("Frontend client connected."); - var deviceSocket = net.connect(18182); + var deviceSocket = net.connect(18183); var packets = new PacketStream(); deviceSocket.pipe(packets);