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

[Android] onClose event not firing on both sockets #16

Closed
micahbule opened this issue Jan 10, 2020 · 6 comments
Closed

[Android] onClose event not firing on both sockets #16

micahbule opened this issue Jan 10, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@micahbule
Copy link

micahbule commented Jan 10, 2020

Description

close event for either client nor server doesn't fire when the other device disconnects.

Steps to reproduce

Steps to reproduce the behavior:

  1. Instantiate a TcpServer on device1 and register an event listener to the close event of the connecting socket.
  2. Create a TcpClient on device2, connect it to device1, and register an event listener to the close event of the client socket.
  3. Call .close() on either the socket connected to the TcpServer, or the one created by the TcpClient.

Current behavior

If you call .close() on the socket connected to the TcpServer, only the event listener on the TcpServer will fire, not the one if the TcpClient. Vice versa.

Expected behavior

Calling .close() on the socket will fire both the close event listeners registered on the server and client.

Relevant information

OS Android
react-native 0.61.4
react-native-tcp-socket 3.1.2
@micahbule micahbule added the bug Something isn't working label Jan 10, 2020
@Rapsssito Rapsssito self-assigned this Jan 10, 2020
@Rapsssito

This comment has been minimized.

@Rapsssito
Copy link
Owner

Rapsssito commented Jan 10, 2020

I have a fix ready. @micahbule, could you tell me if this is also reproducible in iOS?

@micahbule
Copy link
Author

@Rapsssito I haven't tried it on iOS as I don't have a device to try it with.

@Rapsssito
Copy link
Owner

I will release an Android fix since I don't have enough time to debug iOS right now.

@micahbule
Copy link
Author

Sure thing. I'll try to reproduce it on iOS if I have time. Thanks so much!

@Rapsssito
Copy link
Owner

Should be fixed in 3.1.3. Feel free to reopen this issue if the problem persists.

@Rapsssito Rapsssito changed the title Socket onClose event doesn't fire on connected device [Android] Socket onClose event doesn't fire on connected device Jan 10, 2020
@Rapsssito Rapsssito changed the title [Android] Socket onClose event doesn't fire on connected device [Android] onClose event not firing on both sockets Jan 10, 2020
@Rapsssito Rapsssito removed their assignment Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants