+ //
+ // Put the socket back into blocking mode; doing WSAEventSelect()
+ // on the listen socket makes that socket non-blocking, and it
+ // appears that sockets returned from an accept() on that socket
+ // are also non-blocking.
+ //
+ // First, we have to un-WSAEventSelect() this socket, and then
+ // we can turn non-blocking mode off.
+ //
+ if (WSAEventSelect(sockctrl, NULL, 0) == SOCKET_ERROR)
+ {
+ sock_geterror("ioctlsocket(FIONBIO): ", errbuf, PCAP_ERRBUF_SIZE);
+ rpcap_senderror(sockctrl, 0, PCAP_ERR_HOSTNOAUTH, errbuf, NULL);
+ sock_close(sockctrl, NULL, 0);
+ return;
+ }
+ if (ioctlsocket(sockctrl, FIONBIO, &off) == SOCKET_ERROR)
+ {
+ sock_geterror("ioctlsocket(FIONBIO): ", errbuf, PCAP_ERRBUF_SIZE);
+ rpcap_senderror(sockctrl, 0, PCAP_ERR_HOSTNOAUTH, errbuf, NULL);
+ sock_close(sockctrl, NULL, 0);
+ return;
+ }
+