problem with recv AFTER SELECT!!! RRS feed

  • Question

  • it hangs on recv, the socket is returned from listen-> accept, any 1 ever seen something like this, or have any idea whats wrong?


    #define tcp_read(fd,data,len) (recv(fd,data,len,0))
    int read_tcp_socket(void* socket_handle, char* dst, int* len, int timeout){
    	tcp_socket* sock = socket_handle;
    	fd_set fds;
    #ifdef _WIN32
    	struct timeval _timeout;
    	struct _timeval _timeout;
    	_timeout.tv_sec = timeout;
    	_timeout.tv_usec = 0;
    	if(select((int)sock->handle+1,&fds,0,0,&_timeout) < 0){
    		return TCP_FAIL;
    	*len = tcp_read(sock->handle,dst,*len);
    	return TCP_SUCCESS;


    • Edited by hyva_hyypio Tuesday, November 29, 2011 7:52 AM
    Tuesday, November 29, 2011 7:49 AM