非阻塞recvfrom的设置


  int iMode = 1; //0:阻塞
  ioctlsocket(socketc,FIONBIO, (u_long FAR*) &iMode);//非阻塞设置

  rs=recvfrom(socketc,rbuf,sizeof(rbuf),0,(SOCKADDR*)&addr,&len);

int ioctlsocket (
  SOCKET
s,        
  long cmd,        
  u_long FAR* argp 
);

s
[in] A descriptor identifying a socket.
cmd
[in] The command to perform on the socket s.
argp
[in/out] A pointer to a parameter for cmd.

你可能感兴趣的:(ROM)