Skip to content
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

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

Open
souravmunjal opened this issue Jan 17, 2021 · 1 comment
Assignees

Comments

@souravmunjal
Copy link

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;
  }`

@tiholic
Copy link
Contributor

tiholic commented Apr 6, 2021

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants