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.34k stars 975 forks source link

Upgrading the version from 0.8.3 to 2.0.1 not work #707

Closed jiawade closed 2 years ago

jiawade commented 2 years ago

my current socket version is: 0.8.3 my code is: public static void main(String[] args) throws URISyntaxException { IO.Options options = new IO.Options(); options.path = "/socket/"; Socket socket = IO.socket("http://10.12.13.4/socket",options); socket.open(); socket.on(Socket.EVENT_CONNECT, args1 -> { System.out.println("success"); }).on(Socket.EVENT_CONNECT_ERROR, args2 -> { System.out.println("error"); }); socket.connect(); } print success. so this works fine

but, I upgrade to 2.0.1, this not work, print error, Is there anything else I need to do?

darrachequesne commented 2 years ago

Hi! What is the version of the server?

You can check the compatibility table here: https://socketio.github.io/socket.io-client-java/installation.html

jiawade commented 2 years ago

Hi, I looked at our backend socket service and it was: netty-socketio, the details are as follows:

com.corundumstudio.socketio netty-socketio 1.7.18
darrachequesne commented 2 years ago

It seems the netty server implements the previous version of the protocol (Socket.IO 2.x), which is not compatible with the 2.0.1 client: https://github.com/mrniko/netty-socketio#features

jiawade commented 2 years ago

Got it! Thank you very much. @darrachequesne