Lines Matching refs:sock_fd
495 #define IS_SELECTABLE(s) (_PyIsSelectable_fd((s)->sock_fd) || (s)->sock_timeout <= 0.0)
629 sendsegmented(int sock_fd, char *buf, int len, int flags)
638 n = send(sock_fd, buf, segment, flags);
664 setsockopt(s->sock_fd, SOL_SOCKET, SO_NONBLOCK,
671 ioctl(s->sock_fd, FIONBIO, (caddr_t)&block, sizeof(block));
674 ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block);
676 delay_flag = fcntl(s->sock_fd, F_GETFL, 0);
681 fcntl(s->sock_fd, F_SETFL, delay_flag);
685 ioctlsocket(s->sock_fd, FIONBIO, (u_long*)&block);
689 socketioctl(s->sock_fd, FIONBIO, (u_long*)&block);
713 if (s->sock_fd < 0)
727 pollfd.fd = s->sock_fd;
742 FD_SET(s->sock_fd, &fds);
746 n = select(s->sock_fd+1, NULL, &fds, NULL, &tv);
748 n = select(s->sock_fd+1, &fds, NULL, NULL, &tv);
775 outlen = recv(s->sock_fd, cbuf, len, flags);
812 s->sock_fd = fd;
825 socketioctl(s->sock_fd, 0x80046679, (u_long*)&block);
1536 if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
1746 newfd = accept(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
1769 addr = makesockaddr(s->sock_fd, SAS2SA(&addrbuf),
1886 socketioctl(s->sock_fd, 0x80046679, (u_long*)&block);
1925 res = setsockopt(s->sock_fd, level, optname, (void *)buf, buflen);
1966 res = getsockopt(s->sock_fd, level, optname,
1986 res = getsockopt(s->sock_fd, level, optname,
2017 res = bind(s->sock_fd, SAS2SA(&addrbuf), addrlen);
2042 if ((fd = s->sock_fd) != -1) {
2043 s->sock_fd = -1;
2064 res = connect(s->sock_fd, addr, addrlen);
2078 FD_SET(s->sock_fd, &fds);
2080 FD_SET(s->sock_fd, &fds_exc);
2081 res = select(s->sock_fd+1, NULL, &fds, &fds_exc, &tv);
2086 if (FD_ISSET(s->sock_fd, &fds))
2095 assert(FD_ISSET(s->sock_fd, &fds_exc));
2096 if (0 == getsockopt(s->sock_fd, SOL_SOCKET, SO_ERROR,
2122 (void)getsockopt(s->sock_fd, SOL_SOCKET,
2219 return PyInt_FromLong((long) s->sock_fd);
2221 return PyLong_FromLongLong((PY_LONG_LONG)s->sock_fd);
2240 newfd = dup(s->sock_fd);
2273 res = getsockname(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
2277 return makesockaddr(s->sock_fd, SAS2SA(&addrbuf), addrlen,
2302 res = getpeername(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
2306 return makesockaddr(s->sock_fd, SAS2SA(&addrbuf), addrlen,
2335 res = listen(s->sock_fd, backlog);
2391 if (((fd = _open_osfhandle(s->sock_fd, _O_BINARY)) < 0) ||
2394 if ((fd = dup(s->sock_fd)) < 0 || (fp = fdopen(fd, mode)) == NULL)
2443 outlen = recv(s->sock_fd, cbuf, len, flags);
2476 nread = recv(s->sock_fd, read_buf, segment, flags);
2655 n = recvfrom(s->sock_fd, cbuf, len, flags,
2658 n = recvfrom(s->sock_fd, cbuf, len, flags,
2662 n = recvfrom(s->sock_fd, cbuf, len, flags,
2678 if (!(*addr = makesockaddr(s->sock_fd, SAS2SA(&addrbuf),
2818 n = sendsegmented(s->sock_fd, buf, len, flags);
2820 n = send(s->sock_fd, buf, len, flags);
2870 n = sendsegmented(s->sock_fd, buf, len, flags);
2872 n = send(s->sock_fd, buf, len, flags);
2966 n = sendto(s->sock_fd, buf, len, flags, SAS2SA(&addrbuf), addrlen);
3000 res = shutdown(s->sock_fd, how);
3030 if (WSAIoctl(s->sock_fd, cmd, &option, sizeof(option),
3040 if (WSAIoctl(s->sock_fd, cmd, &ka, sizeof(ka),
3142 if (s->sock_fd != -1)
3143 (void) SOCKETCLOSE(s->sock_fd);
3154 long sock_fd;
3156 if (s->sock_fd == INVALID_SOCKET) {
3157 sock_fd = -1;
3160 else if (s->sock_fd > LONG_MAX) {
3171 sock_fd = (long)s->sock_fd;
3175 sock_fd, s->sock_family,
3191 ((PySocketSockObject *)new)->sock_fd = -1;