Compare commits
32
Commits
Saturn-Next
...
retrySOCK
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a100439df | ||
|
|
3b37f85024 | ||
|
|
27a65ef973 | ||
|
|
ffa9b2fa9a | ||
|
|
ab9e0f923e | ||
|
|
8bf3953b4a | ||
|
|
44ef42cf84 | ||
|
|
746035bfea | ||
|
|
70bc9879b3 | ||
|
|
0e6a794a84 | ||
|
|
4eccf40a0a | ||
|
|
e3fd46297a | ||
|
|
4c2e119385 | ||
|
|
229a6a161e | ||
|
|
1b2e4a1acc | ||
|
|
2e6d49fcd6 | ||
|
|
7a8c66781b | ||
|
|
c877226bfe | ||
|
|
ac3c8b1d25 | ||
|
|
feeba45b0d | ||
|
|
06f3d2c91b | ||
|
|
332fadc823 | ||
|
|
39dc1b85e3 | ||
|
|
5b2413444f | ||
|
|
7855b2ed95 | ||
|
|
caebe62ddb | ||
|
|
9de285caac | ||
|
|
9bb4420ad3 | ||
|
|
8dc3d870a1 | ||
|
|
158546bd73 | ||
|
|
b89a3f1017 | ||
|
|
f2e355a5a8 |
+34
-4
@@ -752,9 +752,14 @@ static inline ssize_t SOCK_SendToAddr(SOCKET_TYPE socket, mysockaddr_t *sockaddr
|
||||
|
||||
static void SOCK_Send(void)
|
||||
{
|
||||
ssize_t c = ERRSOCKET;
|
||||
int e = 0; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once
|
||||
size_t i, j;
|
||||
int retrycount = 0;
|
||||
ssize_t c;
|
||||
int e; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once
|
||||
|
||||
retry:
|
||||
c = ERRSOCKET;
|
||||
e = 0;
|
||||
|
||||
if (doomcom->remotenode < 0 || !nodeconnected[doomcom->remotenode])
|
||||
return;
|
||||
@@ -808,10 +813,35 @@ static void SOCK_Send(void)
|
||||
|
||||
if (c == ERRSOCKET && e != 0) // 0 means no socket for the address family was found
|
||||
{
|
||||
if (!ALLOWEDERROR(e))
|
||||
I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
|
||||
if (ALLOWEDERROR(e))
|
||||
return;
|
||||
|
||||
//if (!ALLOWEDERROR(e))
|
||||
//I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
|
||||
//SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
|
||||
|
||||
// no need to spam this on retries
|
||||
if (retrycount == 0)
|
||||
CONS_Alert(CONS_ERROR, "SOCK_Send, error sending to node %d (%s) #%u, %s\n", doomcom->remotenode,
|
||||
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
|
||||
|
||||
// retry sending it
|
||||
if (retrycount <= 3)
|
||||
{
|
||||
CONS_Printf("SOCK_Send: retrying... Attempt %d\n", retrycount+1);
|
||||
retrycount++;
|
||||
// wait quarter of a second or smth
|
||||
I_Sleep(250);
|
||||
goto retry;
|
||||
}
|
||||
|
||||
// no recovery, guess we die
|
||||
I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
|
||||
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
|
||||
}
|
||||
|
||||
if (retrycount > 0)
|
||||
CONS_Alert(CONS_NOTICE, "SOCK_Send: successfully reconnected on Attempt %d\n", retrycount);
|
||||
}
|
||||
#undef ALLOWEDERROR
|
||||
|
||||
|
||||
Reference in new issue
Block a user