Closed demian85 closed 13 years ago
There's currently no onError
method, though there should be. Perhaps you could prepare a patch :P
I'll get around sometime soon hopefully. In the meantime, I suggest placing some log statements throughout the handshake logic and recompiling, to maybe see where something is going wrong. Or using a wire sniffer (Wireshark) to get a view of what's going on that way. Sorry I can't be more help right now!
I have adapted this project for Phonegap, and also implemented onError handler. Check here: https://github.com/anismiles/websocket-android-phonegap/ or https://github.com/anismiles/phonegap-android
-Animesh
@anismiles It would be helpful if you forked and commited the changes as something merge-able
Closing since I got confirmation from @dokipen that this lib does in fact connect successfully to Socket.IO servers, there just needs to be an additional layer on top of this lib that strips away the Socket.IO messaging protocol (i.e. parses JSON, reads heartbeats, session ID, etc.).
Socket.IO is still a problem. How did you fixed that? The WebSocketClient class connects to the server but then immediately close the connection.
java.lang.System.setProperty("java.net.preferIPv4Stack", "true"); java.lang.System.setProperty("java.net.preferIPv6Addresses", "false"); WSClient socket; try { socket = new WSClient(new URI("ws://192.168.1.100:8124")); socket.connect(); } catch (URISyntaxException e) { e.printStackTrace(); }
At the end I also get this message: SntpClient request time failed: java.net.SocketException: Address family not supported by protocol
I used https://github.com/miksago/node-websocket-server instead of Socket.IO
-Animesh
Thanks man... i guess this is the way to go.
Is there any onError method or a way to know if an error occured trying to connect?? I simply cannot connect and I don't know why... the onClose method is called, so?