3
Library that I use: https://github.com/rdavisau/sockets-for-pcl
Follows code:
await client.ConnectAsync(address, port);
The code above is the client and works normal. Let’s say the server is off, when I run the above code, it takes a short time and I get error:
Connection timed out
It takes about 3 minutes to execute this exception. Is there any way to know if the server is listening before executing the above code ? Or decrease 3 minutes to 5 seconds.
Here’s the answer to how to get the status: /a/285103/54019
changes the timeout ?
– Rovann Linhalis
in
system.net.sockets.tcpclient
just change:TCPClient.ReceiveTimeout = 5000; TCPClient.SendTimeout = 5000;
In the one you’re wearing, there must be an equivalent– Rovann Linhalis
is because it’s using a different library, I don’t know it and I don’t know if it’s the same as
system.net.sockets.tcpclient
. That’s all =]– Rovann Linhalis