recv的四个参数我看代码的时候有这样写的recv(sConnect, szpRecvBuf + lFinishLen, lRecvLen - lFinishLen, 0)第四个参数0表示什么意思?我查了半天没有找到。

解决方案 »

  1.   

    查了半天没查到???你应该首先查MSDN:
    int recv (
      SOCKET s,       
      char FAR* buf,  
      int len,        
      int flags       
    );
    flags 
    [in] A flag specifying the way in which the call is made. 
    The flags parameter can be used to influence the behavior of the function invocation beyond the options specified for the associated socket. The semantics of this function are determined by the socket options and the flags parameter. The latter is constructed by or'ing the following values:Value Meaning 
    MSG_PEEK Peek at the incoming data. The data is copied into the buffer but is not removed from the input queue. The function then returns the number of bytes currently pending to receive. 
    MSG_OOB Process out-of-band data. (See section DECnet Out-Of-band data for a discussion of this topic.) 
      

  2.   

    恩~
    楼主安装一下MSDN,然后在索引直接输入 recv就可以查到该函数~~~
    里面有详细的说明:
    The recv function receives data from a connected or bound socket.int recv(
      SOCKET s,
      char* buf,
      int len,
      int flags
    );
      

  3.   

    呵呵。两位,你们看见那个参数的值为0吗?MSG_PEEK,MSG_OOB?不过,谢谢了。我已经找到了。虽然我不明白。
      

  4.   

    MSG_PEEK 是 2
    MSG_OOB  是 1