react-native-tcp-socket icon indicating copy to clipboard operation
react-native-tcp-socket copied to clipboard

fix: crash on write if socket is null

Open cc-steina opened this issue 2 years ago • 2 comments

Sends write exection only if socket is not null. This crashed the app I'm currently working on as described in this Ticket: #153

cc-steina avatar Jun 02 '22 10:06 cc-steina

@cc-steina, thanks for the PR! However, this does not fix the root cause of the issue. Can you when the socket is being set to null after the server disconnection?

Rapsssito avatar Jun 02 '22 16:06 Rapsssito

The Server does not send anything and the client doesent notice that the socket is broken. The Event on close is not being called when the server is just being disconnected from the wifi.

We currently have two phones talking to one another and if the server is just being disconnected from the internet the client doesent seem to notice until it is too late. No close or error event is being emitted allowing the java code to try to use a socket that is actually NULL at that point.

cc-steina avatar Jun 08 '22 11:06 cc-steina

This fix has been implemented in 59d3195a8c68eddb0341c8264d712ed2266d23b5

Rapsssito avatar Nov 21 '22 11:11 Rapsssito