flutter_socket_io icon indicating copy to clipboard operation
flutter_socket_io copied to clipboard

Receiver not called when data is received , when i send data receiver is called

Open souravmunjal opened this issue 5 years ago • 1 comments

I see the socket connected and when i emit the data it works perfectly the data is sent and the receiver for the event is triggered, but when the data is sent from the server the receiver doesn't triggers. I don't know why that's happening?

`initSocket(String identifier) async {
    setState(() => _isProbablyConnected[identifier] = true);
    socket = await manager.createInstance(SocketOptions(
      //Socket IO server URI
      "******************",
      query: {
        "token": "*******",
      }, //Enable required transport
    ));
    socket.onConnect((data) {
      print("connected");
    });
    socket.onConnectError(print);
    socket.onConnectTimeout(print);
    socket.onError(print);
    socket.onDisconnect(print);
    socket.on("receive", (data) {
      setState(() {
        print(data.toString());
      });
    });
    socket.connect();
    sockets[identifier] = socket;
  }`

souravmunjal avatar Jan 17 '21 08:01 souravmunjal

@souravmunjal Are you saying the receive event from server is not triggered?

Can you try and see if this issue is reproduced in new release (v1.0.0)

tiholic avatar Apr 06 '21 11:04 tiholic