You are not logged in.
Pages: 1
int sock_ready(sock)
int sock;
{
int res;
fd_set sready;
struct timeval nowait;
FD_ZERO(&sready);
FD_SET((unsigned int)sock,&sready);
/*bzero((char *)&nowait,sizeof(nowait));*/
memset((char *)&nowait,0,sizeof(nowait));
res = select(sock+1,&sready,NULL,NULL,&nowait);
if( FD_ISSET(sock,&sready) )
res = 1;
else
res = 0;
return(res);
}
Offline
Pages: 1