socketio / socket.io-client-java

Full-featured Socket.IO Client Library for Java, which is compatible with Socket.IO v1.0 and later.
https://socketio.github.io/socket.io-client-java/installation.html
Other
5.32k stars 972 forks source link

How to get the args of the method request onSuccess(Object...args) of the AckWithTimeout class, #717

Closed zy93xy closed 2 years ago

zy93xy commented 2 years ago

The specific calling method is: I use java as the client to call python's server-side

Here is the client java code socket.emit("hello", "world", new AckWithTimeout(5000) { @Override public void onTimeout() { // ... } @Override public void onSuccess(Object... args) { // ... I can't convert it into a usable value when I use it, when I debugged, I found that the args parameter is a numeric object reference Object[0] } });

This is the server side python code sio.emit('result', {key: ",".join(result_list)})

Please help to answer the above questions, thank you!

zy93xy commented 2 years ago

Looking carefully at the documentation has found a solution, the python code uses the event callback in the documentation