Skip to content
Snippets Groups Projects
Commit 915f5d5f authored by rswindell's avatar rswindell
Browse files

Added retry loop (up to 60 times) for socket sends to remote server,

this fixes problem with non-blocking socket returning EWOULDBLOCK.
parent 2e6f7df5
Branches
Tags
No related merge requests found
...@@ -44,6 +44,7 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode) ...@@ -44,6 +44,7 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
uchar buf[512]; uchar buf[512];
int i; int i;
int rd; int rd;
uint attempts;
ulong l; ulong l;
bool gotline; bool gotline;
ushort port; ushort port;
...@@ -193,7 +194,15 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode) ...@@ -193,7 +194,15 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
sem_post(&output_sem); sem_post(&output_sem);
} }
} }
if((i=sendsocket(remote_socket,(char*)buf,rd))<0) { for(attempts=0;attempts<60 && online; attempts++) /* added retry loop here, Jan-20-2003 */
{
if((i=sendsocket(remote_socket,(char*)buf,rd))>=0)
break;
if(ERROR_VALUE!=EWOULDBLOCK)
break;
mswait(500);
}
if(i<0) {
lprintf("!TELGATE ERROR %d sending on socket %d",ERROR_VALUE,remote_socket); lprintf("!TELGATE ERROR %d sending on socket %d",ERROR_VALUE,remote_socket);
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment