Java socket.io client

前端 未结 6 702
醉梦人生
醉梦人生 2020-11-30 19:38

Is there any Socket.IO-client available for Java? So far I have only found the official Socket.IO client which is only available for JavaScript and socket.io-java which is o

相关标签:
6条回答
  • 2020-11-30 20:09

    If you need a client side implementation, checkout java-socket.io.client I made it a few months ago and I believe some people have forked it and upgraded it to the latest version: https://github.com/clwillingham/java-socket.io.client

    0 讨论(0)
  • 2020-11-30 20:21

    Take a look at http://techdroid.kbeanie.com/2011/03/websockets-on-android.html. I only needed the WebSockets, so I stripped out the WebView part as well, the Factory was superfluous also. You can just get away with using https://github.com/anismiles/websocket-android-phonegap/blob/master/src/com/strumsoft/websocket/phonegap/WebSocket.java and implement the SocketIO specifcs yourself.

    0 讨论(0)
  • 2020-11-30 20:22

    Limited options at this time:

    • http://code.google.com/p/weberknecht/

    • https://github.com/TooTallNate/Java-WebSocket

    • https://github.com/Gottox/socket.io-java-client

    sound right as far as WebSockets go. Socket.IO's specific wire protocol do not appear to have been implemented in Java yet, so you may have to deal with that yourself.

    0 讨论(0)
  • 2020-11-30 20:32

    Judging from http://socket.io under "Supported Transports" it could be several different transport protocols:

    WebSocket, Adobe® Flash® Socket, AJAX long polling, AJAX multipart streaming, Forever Iframe, JSONP Polling

    So, the question is, what is your server supporting?

    From the perspective of Java clients the easiest would be WebSockets.

    0 讨论(0)
  • 2020-11-30 20:34

    You can use socket.io-client.java.

    See this link for src code.

    You can also find a tutorial here

    0 讨论(0)
  • 2020-11-30 20:36

    There is an other Library it is Jetty: http://www.eclipse.org/jetty/documentation/current/jetty-websocket-client-api.html

    0 讨论(0)
提交回复
热议问题