New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onClose called immediately when trying to connect (handshake silently fails?) #13
Comments
I'm assuming that you based this on my (somewhat partial) socket.io client implementation. |
Thanks for the suggestion. However, I did override the send method. I don't know what the problem is because I just tested it with another node package (Node WebSocket Server: https://github.com/miksago/node-websocket-server ) and that one is working. That means it is a socket.io problem, but I haven't found anything about this issue in the socket.io documentation. :( |
I suppose this should be filed as a bug with Socket.IO then. Or how about testing with the trunk? |
I also suggest logging all messages received and sent to see if it happens because of something that it expects a reply to. |
What do you mean? There are no messages received client-side (you mean when/if the onMessage() event is called?). Server side is not a big success either. I don't see any output from socket.io. In addition to this, the socket.io is pretty outdated, because I get errors when trying to execute the examples from their README.md file. I can't configure socket.io to print more debug output.. Following the instructions for cloning the git repository (from https://github.com/learnboost/socket.io-node/tree/06) is not working either. I ran the server from the example folder but get the same output. I guess I should report this to socket.io then... |
Probably. Do keep in mind though that my client was written with Trial-and-Error for Tornadio. |
Oh wow, I wish GitHub would notify me of updates on Issues after the initial opening of the Issue. In any case, did you get this figured out? I don't think it's a Java-WebSocket issue, since I've had reports of people using this lib with Socket.IO in the past. |
I have exactly the same problem! |
Closing since this isn't an issue with Java-WekSocket itself, but rather your (lack of a) Socket.IO compatibility layer... |
True. Use http://static.brandedcode.com/nws-docs/. |
@xpepermint, that just seems to be the server API, not the wire protocol. |
Well... I experienced the same behaviour (onClose called immediately when trying to connect) when I was using Node.js+Socket.io. I now use websocket server (http://static.brandedcode.com/nws-docs/) with Node.JS (http://nodejs.org). |
Oh, right, way for me to not read the title. Sorry. |
np :) |
Sorry for the late reply, but no, I haven't been able to solve the issue with Socket.IO. Furthermore, I've been using the Node Websocket Server too. It actually suffices, because I'm writing a native Android app that is only able to connect through websockets, so I guess Socket.IO wouldn't give me any advantage over NWS. Anyway, thanks for the help and advice everyone! |
I've got an issue when trying to connect to a socket.io server with the Java-WebSocket client code. My server is socket.io on node.js (very simple example from socket.io website). When I connect, I get an onClose event immediately. I've written some output in the connection and handshaking process and I think the handshake is failing.
Here is the call stack:
in Client constructor (self written class extending WebSocketClient):
Creating client.
All the following calls happen in the WebSocketClient class:
Handled read.
I have no idea if this call stack is useful and/or this issue is in the right place. But I've been trying several things and have no idea what to do exactly. Is it a bug in the handshake/specification? Or something I'm doing wrong? I merely implemented the onClose, onOpen, onMessage methods and just called the connect() method.
The text was updated successfully, but these errors were encountered: