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

fix(Android): Add missing timeout argument to socket.connect()

Open jesperjohansson opened this issue 2 years ago • 4 comments

Adds previously missing usage of timeout option

jesperjohansson avatar Apr 21 '22 11:04 jesperjohansson

@jesperjohansson, thanks for the PR! However, the timeout has been moved to the JS part of the code, as you can see here: https://github.com/Rapsssito/react-native-tcp-socket/blob/c68215ca5e8d196cb069c6d8cfc3817fe3f28f4a/src/Socket.js#L153-L169

Rapsssito avatar Apr 22 '22 21:04 Rapsssito

@Rapsssito Without the timeout in native level I couldn't connect successfully after a timeout, all sequent attempts would timeout

jesperjohansson avatar Apr 25 '22 06:04 jesperjohansson

@jesperjohansson, I didn't know that was happening. Then there must be a bug in the JS code.

Rapsssito avatar Apr 25 '22 14:04 Rapsssito

This timeout is necessary for finishing connecting mode and being ready to reconnecting on another Host.

c0mm4nDer avatar Aug 03 '22 07:08 c0mm4nDer

@jesperjohansson @c0mm4nDer the timeout option is going to be deleted soon as it does not comply with Node's net API.

Rapsssito avatar Sep 30 '22 14:09 Rapsssito