naomi network: ignore WSAECONNRESET. Longer timeout for client
This commit is contained in:
parent
554ffcd08f
commit
7fcce4a59b
|
@ -88,10 +88,10 @@ bool NaomiNetwork::startNetwork()
|
|||
slaves.clear();
|
||||
|
||||
using namespace std::chrono;
|
||||
const auto timeout = seconds(20);
|
||||
|
||||
if (config::ActAsServer)
|
||||
{
|
||||
const auto timeout = seconds(20);
|
||||
NOTICE_LOG(NETWORK, "Waiting for slave connections");
|
||||
steady_clock::time_point start_time = steady_clock::now();
|
||||
|
||||
|
@ -131,6 +131,7 @@ bool NaomiNetwork::startNetwork()
|
|||
}
|
||||
else
|
||||
{
|
||||
const auto timeout = seconds(30);
|
||||
serverIp = INADDR_BROADCAST;
|
||||
u16 serverPort = SERVER_PORT;
|
||||
if (!config::NetworkServer.get().empty())
|
||||
|
|
|
@ -157,6 +157,11 @@ private:
|
|||
int error = get_last_error();
|
||||
if (error == L_EWOULDBLOCK || error == L_EAGAIN)
|
||||
break;
|
||||
#ifdef _WIN32
|
||||
if (error == WSAECONNRESET)
|
||||
// Happens if the previous send resulted in an ICMP Port Unreachable message
|
||||
break;
|
||||
#endif
|
||||
throw Exception("Receive error: errno " + std::to_string(error));
|
||||
}
|
||||
if (rc < (int)packet.size(0))
|
||||
|
|
Loading…
Reference in New Issue