You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello developers, I have just recently used the react-native TCP and I encountered with connection refused error while creating the connection if the server is closed, how I handled it, I used net.connect() method rather than create connection, then error event handle the connection refused error, I am pasting the code here so you can see it, Thank you.
`const client = await net.connect(5000,data[i].ipdata_ip,()=>{
client.write(JSON.stringify({
tableNum: tab,
time: Moment(new Date()).format('MM-DD-YYYY hh:mm:ss A')
}));
client.destroy()
})
client.on('error',(error)=>{
alert(Configuration kitchen error at screen ${data[i].ipdata_ip})
})`
Hello, I'm trying to handle a connection refused error, if I try to connect to a server that doesn't exist, my app crash.
I've try something like this:
and also:
But the App still continue to crash with the
Connection Refused
ExceptionThe text was updated successfully, but these errors were encountered: