Lines Matching refs:sock_fd
471 #define IS_SELECTABLE(s) (_PyIsSelectable_fd((s)->sock_fd) || (s)->sock_timeout <= 0.0)
605 sendsegmented(int sock_fd, char *buf, int len, int flags)
614 n = send(sock_fd, buf, segment, flags);
640 setsockopt(s->sock_fd, SOL_SOCKET, SO_NONBLOCK,
647 ioctl(s->sock_fd, FIONBIO, (caddr_t)&block, sizeof(block));
650 ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block);
652 delay_flag = fcntl(s->sock_fd, F_GETFL, 0);
657 fcntl(s->sock_fd, F_SETFL, delay_flag);
661 ioctlsocket(s->sock_fd, FIONBIO, (u_long*)&block);
665 socketioctl(s->sock_fd, FIONBIO, (u_long*)&block);
689 if (s->sock_fd < 0)
703 pollfd.fd = s->sock_fd;
718 FD_SET(s->sock_fd, &fds);
722 n = select(s->sock_fd+1, NULL, &fds, NULL, &tv);
724 n = select(s->sock_fd+1, &fds, NULL, NULL, &tv);
751 outlen = recv(s->sock_fd, cbuf, len, flags);
788 s->sock_fd = fd;
801 socketioctl(s->sock_fd, 0x80046679, (u_long*)&block);
1512 if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
1721 newfd = accept(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
1744 addr = makesockaddr(s->sock_fd, SAS2SA(&addrbuf),
1861 socketioctl(s->sock_fd, 0x80046679, (u_long*)&block);
1900 res = setsockopt(s->sock_fd, level, optname, (void *)buf, buflen);
1941 res = getsockopt(s->sock_fd, level, optname,
1961 res = getsockopt(s->sock_fd, level, optname,
1992 res = bind(s->sock_fd, SAS2SA(&addrbuf), addrlen);
2017 if ((fd = s->sock_fd) != -1) {
2018 s->sock_fd = -1;
2039 res = connect(s->sock_fd, addr, addrlen);
2053 FD_SET(s->sock_fd, &fds);
2055 FD_SET(s->sock_fd, &fds_exc);
2056 res = select(s->sock_fd+1, NULL, &fds, &fds_exc, &tv);
2061 if (FD_ISSET(s->sock_fd, &fds))
2070 assert(FD_ISSET(s->sock_fd, &fds_exc));
2071 if (0 == getsockopt(s->sock_fd, SOL_SOCKET, SO_ERROR,
2097 (void)getsockopt(s->sock_fd, SOL_SOCKET,
2194 return PyInt_FromLong((long) s->sock_fd);
2196 return PyLong_FromLongLong((PY_LONG_LONG)s->sock_fd);
2215 newfd = dup(s->sock_fd);
2248 res = getsockname(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
2252 return makesockaddr(s->sock_fd, SAS2SA(&addrbuf), addrlen,
2277 res = getpeername(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
2281 return makesockaddr(s->sock_fd, SAS2SA(&addrbuf), addrlen,
2310 res = listen(s->sock_fd, backlog);
2366 if (((fd = _open_osfhandle(s->sock_fd, _O_BINARY)) < 0) ||
2369 if ((fd = dup(s->sock_fd)) < 0 || (fp = fdopen(fd, mode)) == NULL)
2418 outlen = recv(s->sock_fd, cbuf, len, flags);
2451 nread = recv(s->sock_fd, read_buf, segment, flags);
2630 n = recvfrom(s->sock_fd, cbuf, len, flags,
2633 n = recvfrom(s->sock_fd, cbuf, len, flags,
2637 n = recvfrom(s->sock_fd, cbuf, len, flags,
2653 if (!(*addr = makesockaddr(s->sock_fd, SAS2SA(&addrbuf),
2793 sock_fd, buf, len, flags);
2795 n = send(s->sock_fd, buf, len, flags);
2845 n = sendsegmented(s->sock_fd, buf, len, flags);
2847 n = send(s->sock_fd, buf, len, flags);
2941 n = sendto(s->sock_fd, buf, len, flags, SAS2SA(&addrbuf), addrlen);
2975 res = shutdown(s->sock_fd, how);
3005 if (WSAIoctl(s->sock_fd, cmd, &option, sizeof(option),
3015 if (WSAIoctl(s->sock_fd, cmd, &ka, sizeof(ka),
3117 if (s->sock_fd != -1)
3118 (void) SOCKETCLOSE(s->sock_fd);
3129 long sock_fd;
3131 if (s->sock_fd == INVALID_SOCKET) {
3132 sock_fd = -1;
3135 else if (s->sock_fd > LONG_MAX) {
3146 sock_fd = (long)s->sock_fd;
3150 sock_fd, s->sock_family,
3166 ((PySocketSockObject *)new)->sock_fd = -1;