-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Host not reachable error handling #121
Comments
@sudray, I am sorry for your issue. Could you provide a minimal reproducible example code so I can test it in my local setup? |
please clear me if I am wrong this happens on android
if I closed the server app any time, immediately the client raises a close event and this is great |
@Rapsssito Any Information? |
@Mohamed-kassim, sorry for my late reply. I am working on handling the same errors on iOS and Android. I will close this issue as soon as this is fixed! |
@Rapsssito no problem, currently, I am syning the server manually with interval and waits for ack to detect when it's down as a workaround |
@Mohamed-kassim could you please share how you solve your problem? |
Description
Hi I have been evaluating your module as an update for some older react-tcp code and it performs well.
Great job and good work in keeping the calls similar to the Node "net"module. Makes for easy use and implementation.
I am an embedded programmer and have decent knowledge of embedded tcp/ip sockets in the micro-controller domain.
My react native app creates multiple tcp clients, all connecting to some hardware and exchanging data.
All events such as connect() / data() / close() / error() ) work perfectly well and I have created and connected up to 30 simultaneous clients with no issues at all in iOS & Android.
Steps to reproduce
If some or all servers are OFF and not reachable on the network, the iOS version tries to connect and then has an error and subsequently the close event destroys the client and our routine tries to reconnect again...and all is well.....
In android ( when some or all servers ore OFF ) an error is called within 3 seconds of the connect() function ( even though the connect timeout is set to 5 seconds or greater ) and then an error followed by close occurs.
Our code is setup to reconnect and tries but eventually after a few minutes the app crashes.
The effect is more pronounced when more client sockets are trying to connect to unreachable servers.
I have even tried adding a 10 second delay after socket.destroy and connecting again, to no avail...
Current behavior
If the server is offline or down or unreachable the app crashes
The error is occurring at java level and i do not have a screenshot right now but will share one asap
Expected behavior
The error() event should fire followed by the close() event
Relevant information
React Native 0.64
Xcode 13
Android studio 2021.1.1
Notes
Would love to hear what the possible issues could be and if any possible solutions suggested.
Will share any further details as required, and would love to sponsor your work ( for basic prioritized bug support )
Cheers !!
sudray
The text was updated successfully, but these errors were encountered: