socket.io-client-cpp
socket.io-client-cpp copied to clipboard
call ACK when receive message
Hi it seems to be no way to call ack when receive message sio::socket::event_listener_aux([&](string const& name, message::ptr const& data, bool isAck, message::list& ack_resp)
what is ack_resp for? It suppose to be a function to call instead of message
this is how java implement ack.
public void call(final Object... args) {
EventThread.exec(new Runnable() {
public void run() {
if (!sent[0]) {
sent[0] = true;
Socket.logger.fine(String.format("sending ack %s", args.length != 0 ? args : null));
int type = HasBinary.hasBinary(args) ? 6 : 3;
Packet<JSONArray> packet = new Packet(type, new JSONArray(Arrays.asList(args)));
packet.id = id;
Socket.this.packet(packet);
}
}
});
}
Need to find out
I got it worked by this:
packet p(packet::type_ack); send_packet(p);
this works as Ack.call() of java
Hi, I'm having the same issue: I just want to send response on a request. Can you please extend your solution?