|
|
@ -223,7 +223,6 @@ int32_t LP_socketrecv(int32_t sock,uint8_t *recvbuf,int32_t maxlen) |
|
|
|
int32_t recvlen = -1; |
|
|
|
while ( 1 ) |
|
|
|
{ |
|
|
|
printf("recv on sock.%d\n",sock); |
|
|
|
if ( (recvlen= (int32_t)recv(sock,recvbuf,maxlen,0)) < 0 ) |
|
|
|
{ |
|
|
|
if ( errno == EAGAIN ) |
|
|
@ -258,7 +257,7 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch |
|
|
|
if ( poll(&fds,1,timeout) > 0 && (fds.revents & POLLOUT) != 0 && (str= *sendstrp) != 0 ) |
|
|
|
{ |
|
|
|
*sendstrp = 0; |
|
|
|
printf("sending.(%s)\n",str); |
|
|
|
//printf("sending.(%s)\n",str);
|
|
|
|
if ( LP_socketsend(sock,(uint8_t *)str,(int32_t)strlen(str)) <= 0 ) |
|
|
|
{ |
|
|
|
printf("%s:%u is dead\n",ipaddr,port); |
|
|
@ -266,11 +265,6 @@ void LP_dedicatedloop(int32_t (*recvfunc)(char *ipaddr,char *str,int32_t len),ch |
|
|
|
sock = -1; |
|
|
|
break; |
|
|
|
} |
|
|
|
else if ( (len= LP_socketrecv(sock,buf,bufsize)) > 0 ) |
|
|
|
{ |
|
|
|
(*recvfunc)(ipaddr,(char *)buf,len); |
|
|
|
flag++; |
|
|
|
} else printf("recv.%d\n",len); |
|
|
|
flag++; |
|
|
|
} |
|
|
|
if ( flag == 0 ) |
|
|
|