feat:pass the breakpoint debug
This commit is contained in:
parent
20ca4b013d
commit
8ce32b8769
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user