Java implementation for client Socket.io compatibl

2020-02-11 10:10发布

问题:

It is almost 1 week that I am wasting time trying to find a WORKING library that implements the client side of Socket.IO compatible with v. 1.0

Mentioning just the most relevant results...so far I found: 1. https://github.com/nkzawa/socket.io-client.java which I compiled (not without difficulties) and tried to link to my project without success since it gives me an error on the Emitter class that I couldn't solve. 2. https://github.com/Gottox/socket.io-java-client that is compatible till version 0.9 and seems no longer maintained.

Has anyone found an implementation working with v. 1.0(and has tried it)? Or do you advice me to downgrade to versione 0.9? Just to be more specific, I need it to keep the sync between my Android app and my server.

Thanks for your help!

回答1:

I had the exact same problem and I got nkzawa's solution working. You need to install quite a few dependencies if you aren't using Maven

Necessary:

  • engine.io-client
  • Java-Websocket
  • json

Unnecessary:

  • hamcrest-library
  • jsonassert
  • junit

Also don't forget socket.io-client!