非阻塞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.
posted @ 2008-01-09 11:56  ahuo  阅读(9147)  评论(3编辑  收藏  举报