Lines Matching refs:fd
237 SOCKET fd; /* file handle */
392 printf("\t\tfd: %u\n", sock->fd);
545 hiocp = CreateIoCompletionPort((HANDLE)sock->fd,
589 if (sock->fd != INVALID_SOCKET) {
590 closesocket(sock->fd);
591 sock->fd = INVALID_SOCKET;
676 Result = WSASendTo(sock->fd, messagehdr->msg_iov,
745 INSIST(sock->fd != INVALID_SOCKET);
762 Result = WSARecvFrom((SOCKET)sock->fd, iov, 1,
813 "queue_io_request: fd %d result %d error %d",
814 sock->fd, Result, Error);
873 * Make an fd SOCKET non-blocking.
876 make_nonblock(SOCKET fd) {
882 ret = ioctlsocket(fd, FIONBIO, &flags);
888 fd, flags, strbuf);
907 connection_reset_fix(SOCKET fd) {
916 status = WSAIoctl(fd, SIO_UDP_CONNRESET, &bNewBehavior,
1089 printf("MSGHDR %p, Socket #: %u\n", msg, sock->fd);
1418 sock->fd, *nbytes, *send_errno, strbuf);
1436 (void)setsockopt(sock->fd, IPPROTO_IPV6, IPV6_USE_MIN_MTU,
1460 sock->fd = INVALID_SOCKET;
1592 || sock->fd != INVALID_SOCKET) {
1613 "freeing socket line %d fd %d lock %p semaphore %p",
1614 lineno, sock->fd, &sock->lock, sock->lock.LockSemaphore);
1665 sock->fd = socket(pf, SOCK_DGRAM, IPPROTO_UDP);
1666 if (sock->fd != INVALID_SOCKET) {
1667 result = connection_reset_fix(sock->fd);
1673 closesocket(sock->fd);
1675 sock->fd = INVALID_SOCKET;
1682 sock->fd = socket(pf, SOCK_STREAM, IPPROTO_TCP);
1686 if (sock->fd == INVALID_SOCKET) {
1713 result = make_nonblock(sock->fd);
1719 closesocket(sock->fd);
1720 sock->fd = INVALID_SOCKET;
1738 && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO,
1743 "%s: %s", sock->fd,
1753 && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_PKTINFO,
1758 sock->fd,
1771 if (getsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF,
1775 (void)setsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF,
1799 ISC_MSG_CREATED, "created %u type %u", sock->fd, type);
1851 if (sock->references == 0 && sock->fd != INVALID_SOCKET) {
1852 closesocket(sock->fd);
1853 sock->fd = INVALID_SOCKET;
2027 result = make_nonblock(adev->newsocket->fd);
2035 INSIST(setsockopt(nsock->fd, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT,
2036 (char *)&sock->fd, sizeof(sock->fd)) == 0);
2052 "accepted_connection new_socket %p fd %d",
2053 nsock, nsock->fd);
2090 if (sock->fd != INVALID_SOCKET) {
2091 closesocket(sock->fd);
2092 sock->fd = INVALID_SOCKET;
2106 * fd and pretend nothing strange happened.
2142 INSIST(setsockopt(sock->fd, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0) == 0);
2352 if (nsock->fd == INVALID_SOCKET) {
2355 closesocket(nsock->fd);
2356 nsock->fd = new_fd;
2360 ISCAcceptEx(parent->fd,
2361 nsock->fd, /* Accepted Socket */
2498 closesocket(lpo->adev->newsocket->fd);
2499 lpo->adev->newsocket->fd = INVALID_SOCKET;
2736 if (sock->fd == INVALID_SOCKET)
2778 if (sock->fd == INVALID_SOCKET) {
2845 if (sock->fd == INVALID_SOCKET) {
2883 if (sock->fd == INVALID_SOCKET) {
3006 if (sock->fd == INVALID_SOCKET) {
3068 if (sock->fd == INVALID_SOCKET) {
3124 if (sock->fd == INVALID_SOCKET) {
3153 if (sock->fd == INVALID_SOCKET) {
3169 setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on,
3172 "setsockopt(%d) %s", sock->fd,
3177 if (bind(sock->fd, &sockaddr->type.sa, sockaddr->length) < 0) {
3236 if (sock->fd == INVALID_SOCKET) {
3248 if (listen(sock->fd, (int)backlog) < 0) {
3291 if (sock->fd == INVALID_SOCKET) {
3322 nsock->fd = socket(sock->pf, SOCK_STREAM, IPPROTO_TCP);
3323 if (nsock->fd == INVALID_SOCKET) {
3361 ISCAcceptEx(sock->fd,
3362 nsock->fd, /* Accepted Socket */
3374 "accepting for nsock %p fd %d", nsock, nsock->fd);
3416 if (sock->fd == INVALID_SOCKET) {
3428 if (bind(sock->fd, &any.type.sa, any.length) < 0) {
3474 ISCConnectEx(sock->fd, &addr->type.sa, addr->length,
3492 WSAConnect(sock->fd, &addr->type.sa, addr->length, NULL, NULL, NULL, NULL);
3515 if (sock->fd == INVALID_SOCKET) {
3547 if (sock->fd == INVALID_SOCKET) {
3560 if (getsockname(sock->fd, &addressp->type.sa, (void *)&len) < 0) {
3597 if (sock->fd == INVALID_SOCKET) {
3664 closesocket(dev->newsocket->fd);
3665 dev->newsocket->fd = INVALID_SOCKET;
3691 closesocket(sock->fd);
3692 sock->fd = INVALID_SOCKET;
3716 if (sock->fd == INVALID_SOCKET) {
3738 if (sock->fd == INVALID_SOCKET) {
3761 (void)setsockopt(sock->fd, IPPROTO_IPV6, IPV6_V6ONLY,