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
Socket.IO acknowledgement #33
Comments
Coincidentally, very soon! I am in the process of refactoring the socket.io client to add that feature, as well as many others. Check out the "wip" branch. Should be released this weekend. |
Cool.. Thanks alot. |
Fixed in the master branch. Will push to Maven soon. Requiring an ack: SocketIOClient client = SocketIOClient.connect(AsyncHttpClient.getDefaultInstance(), "http://koush.clockworkmod.com:8080/", null).get();
client.emit("hello", new Acknowledge() {
@Override
public void acknowledge(JSONArray arguments) {
}
}); Sending an ack: SocketIOClient client = SocketIOClient.connect(AsyncHttpClient.getDefaultInstance(), "http://koush.clockworkmod.com:8080/", null).get();
client.setStringCallback(new StringCallback() {
@Override
public void onString(String string, Acknowledge acknowledge) {
assertNotNull(acknowledge);
acknowledge.acknowledge(new JSONArray().put(string));
}
}); |
Are you sure acknowledges pass correct arguments ? |
Let me double check. I'm fairly certain it does, as I have tests unit tests around it. |
Hi, I have worked with the acknowledge call back.It does the job well as intented.. |
@g00fy- if you could let me know which socket.io server and version you are on, i can take a look. |
I am using this is the server code :
on the client - browser this code works:
|
@g00fy- Thanks, will take a look with that test code. |
@koush any news about this issue? I was using 1.1.4 jar. Maybe the format of the websocket message is invalid ? |
Haven't had a chance to look at this yet, I'll be free this weekend I think |
Please verify so I can close this issue. |
@koush Works! Thanks! |
I have the same issue, on the server,if I use socket to emit a command , the acknowledge on client is ok , if I use io.sockets to emit a command, the acknowledge on the client is null server code: socket.emit('command',{"commandStr":"testhenry"},function(d){
the acknowledge is null. |
Hi,
I am looking for acknowledgment function for the socket io client, there are some socket event callback in my project need to get acknowledgement. Is this available?
Thanks.
The text was updated successfully, but these errors were encountered: