diff --git a/Android/doric/src/main/java/pub/doric/engine/remote/RemoteJSExecutor.java b/Android/doric/src/main/java/pub/doric/engine/remote/RemoteJSExecutor.java index 385c644a..9917c60d 100644 --- a/Android/doric/src/main/java/pub/doric/engine/remote/RemoteJSExecutor.java +++ b/Android/doric/src/main/java/pub/doric/engine/remote/RemoteJSExecutor.java @@ -40,7 +40,7 @@ public class RemoteJSExecutor { .readTimeout(10, TimeUnit.SECONDS) .writeTimeout(10, TimeUnit.SECONDS) .build(); - final Request request = new Request.Builder().url("ws://192.168.24.166:2080").build(); + final Request request = new Request.Builder().url("ws://192.168.24.221:2080").build(); final Thread current = Thread.currentThread(); webSocket = okHttpClient.newWebSocket(request, new WebSocketListener() { @@ -116,7 +116,7 @@ public class RemoteJSExecutor { } catch (Exception ex) { ex.printStackTrace(); } finally { - //LockSupport.unpark(current); + LockSupport.unpark(current); } } break; @@ -165,7 +165,7 @@ public class RemoteJSExecutor { jo.addProperty("hashKey", hashKey); webSocket.send(gson.toJson(jo)); - // LockSupport.park(Thread.currentThread()); + LockSupport.park(Thread.currentThread()); return null; } diff --git a/Android/doric/src/main/java/pub/doric/engine/remote/ValueBuilder.java b/Android/doric/src/main/java/pub/doric/engine/remote/ValueBuilder.java index d369e055..34aa21f0 100644 --- a/Android/doric/src/main/java/pub/doric/engine/remote/ValueBuilder.java +++ b/Android/doric/src/main/java/pub/doric/engine/remote/ValueBuilder.java @@ -67,7 +67,7 @@ public class ValueBuilder { write(output, key); write(output, ((JSONObject) O).opt(key)); } - writeInt(output, 0); + output.write((byte) 'N'); } else if (O instanceof JSONArray) { output.write((byte) 'A'); writeInt(output, ((JSONArray) O).length()); diff --git a/js-framework/index.debug.ts b/js-framework/index.debug.ts index 79f33b81..9d9c2f20 100644 --- a/js-framework/index.debug.ts +++ b/js-framework/index.debug.ts @@ -24,12 +24,13 @@ global.Entry = doric.jsObtainEntry(contextId) const wss = new WebSocket.Server({ port: 2080 }) wss.on('connection', function connection(ws) { + console.log('Connected') ws.on('message', function incoming(message: string) { let messageObject = JSON.parse(message) switch (messageObject.cmd) { case "injectGlobalJSFunction": console.log(messageObject.name) - Reflect.set(global, messageObject.name, function() { + Reflect.set(global, messageObject.name, function () { let args = [].slice.call(arguments) console.log("===============================") console.log(args) @@ -46,7 +47,7 @@ wss.on('connection', function connection(ws) { console.log(messageObject.functionName) let args = [] - for (let i = 0;i < messageObject.javaValues.length;i++) { + for (let i = 0; i < messageObject.javaValues.length; i++) { let javaValue = messageObject.javaValues[i] if (javaValue.type === 0) { args.push(null)