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

TcpSocketClient callback queues are being lost between instances #86

Open
beau6183 opened this issue Sep 7, 2018 · 0 comments · May be fixed by #87
Open

TcpSocketClient callback queues are being lost between instances #86

beau6183 opened this issue Sep 7, 2018 · 0 comments · May be fixed by #87

Comments

@beau6183
Copy link

beau6183 commented Sep 7, 2018

I can submit a sample project to prove the issue, but it appears that callbacks are being referenced from different instances of TcpSocketClient and failing.

TcpSockets creates an instance of TcpSocketClient at init. Then, on first client connection, a new TcpSocketClient instance is created by TcpSockets, but the callbacks from write are saved in the first instances's _pendingSends. When the message is written to the socket and the callback is requested to call, the second instance checks it's own _pendingSends for the callback and cannot locate it. This causes a lock on writes after the first message is sent.

I have a fix which moves the _pendingWrites queue (and _sendTag) to the delegate and handled centrally through delegate handlers. Will submit a PR.

beau6183 pushed a commit to beau6183/react-native-tcp that referenced this issue Sep 7, 2018
@beau6183 beau6183 linked a pull request Sep 7, 2018 that will close this issue
sausaw added a commit to sausaw/react-native-tcp that referenced this issue Nov 30, 2018
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

Successfully merging a pull request may close this issue.

1 participant