-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
iOS: No client found with id X #64
Comments
@deiv23, you are calling the socket before it has been created. You have to use the callback provided by var options = {port:4444, host: x.x.x.x, reuseAddress:true, localAdress: y.y.y.y, localPort:4445}
// TcpSocket.createConnection is async
var client = TcpSocket.createConnection(options, () => {
client.write(JSON.stringify(jsArray));
});
client.on('error', function(error) {
console.log(error)
});
client.on('data', function(data) {
client.destroy();
}); I will update the docs to make it clear. |
@Rapsssito thanks for the reply. Im trying to implement but that callback doesn't get called, I don't know why |
@deiv23, you can take a look at the example code for a more exhaustive example. |
@Rapsssito I have the callback working, but second time I execute the function send, the createConnection callback isn't called. No errors shown. |
@deiv23, it might be related to a bad config on your server or a wrong logic on your client's code. I cannot help you without any more information. |
Hi, i tried with react-native-tcp and now its working fine. Thanks for your
help anyway
El El mié, 8 jul 2020 a las 13:08, Rodrigo Martin <notifications@github.com>
escribió:
… @deiv23 <https://github.com/deiv23>, it might be related to a bad config
on your server or a wrong logic on your client's code. I cannot help you
without any more information.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#64 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKXLBG77BRTHK7N5KZB5NRDR2RHSNANCNFSM4ORVXMOQ>
.
|
Description
I have problems on IOS, when I try to reuse the socket I receive:
Error in connect() function
no client found with id X
Dependencies
react-native 0.61.5
react-native-tcp-socket 3.2.4
Steps to reproduce the behavior:
calling a function like this twice.
Current behavior
if I execute the send() function once, everything works ok
second time gives the error:
Error in connect() function
no client found with id X
In android works ok every time.
Expected behavior
work ok on second try
The text was updated successfully, but these errors were encountered: