recv SO_RCVTIMEO

programming/C_C++ 2011. 5. 19. 13:36
반응형

struct timeval timeout; //setting timeout to socket
timeout.tv_sec=MY_TIMEOUT_VAL;
timeout.tv_usec=0;

result= setsockopt(*sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); //timeout 지정

rcv_len= recv(*sock, recv_buf, MY_RECV_LEN, MSG_WAITALL);

 

http://kldp.org/

반응형
Posted by 공간사랑
,