socket.io-client-dart icon indicating copy to clipboard operation
socket.io-client-dart copied to clipboard

emitWithAck pending forever

Open hatemragab opened this issue 3 years ago • 1 comments

emitWithAck callback function pending forever if no response from server is there time out callback support? or extral arg for handle errors

  Future emitChangeMessageStatus({@required String statuses}) async {
     var c = Completer();
     socket.emitWithAck("change_message_status", statuses, ack: (data) {
      if(data!=null){
         c.complete(data);
      }else{
         c.complete("Error !");
        }
     
    });
    return await c.future;
  }

c.complete("Error !"); Never invoke

hatemragab avatar Mar 03 '21 07:03 hatemragab

I was having the same error.

https://github.com/rikulo/socket.io-client-dart/issues/147#issuecomment-770543188 helped in my case.

Pulkit07 avatar Mar 06 '21 16:03 Pulkit07