mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-10-19 17:18:59 +02:00
Traversal: update pending-packet time on socket timeout
Pending traversal packets were only expired after receive events. If a client did not acknowledge a response and no more packets arrived, the server retained the pending entry indefinitely. Update the current time before handling socket timeouts. Pending packets will then retry and expire while the server is idle.
This commit is contained in:
1 parent
bb3558a70e
commit
93097f65ea
1 file changed
+3
-3
@@ -470,6 +470,9 @@ int main()
|
||||
FD_SET(sock, &readSet);
|
||||
FD_SET(sockAlt, &readSet);
|
||||
rv = select(std::max(sock, sockAlt) + 1, &readSet, nullptr, nullptr, &tv);
|
||||
currentTime = std::chrono::duration_cast<std::chrono::microseconds>(
|
||||
std::chrono::steady_clock::now().time_since_epoch())
|
||||
.count();
|
||||
if (rv < 0)
|
||||
{
|
||||
if (errno != EINTR && errno != EAGAIN)
|
||||
@@ -499,9 +502,6 @@ int main()
|
||||
// note: switch to recvmmsg (yes, mmsg) if this becomes
|
||||
// expensive
|
||||
rv = recvfrom(recvsock, &packet, sizeof(packet), 0, (sockaddr*)&raddr, &addrLen);
|
||||
currentTime = std::chrono::duration_cast<std::chrono::microseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
.count();
|
||||
if (rv < 0)
|
||||
{
|
||||
if (errno != EINTR && errno != EAGAIN)
|
||||
|
||||
Reference in new issue
Block a user