Lines Matching refs:sock_fd
470 #define IS_SELECTABLE(s) ((s)->sock_fd < FD_SETSIZE || s->sock_timeout <= 0.0)
593 sendsegmented(int sock_fd, char *buf, int len, int flags)
602 n = send(sock_fd, buf, segment, flags);
628 setsockopt(s->sock_fd, SOL_SOCKET, SO_NONBLOCK,
635 ioctl(s->sock_fd, FIONBIO, (caddr_t)&block, sizeof(block));
638 ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block);
640 delay_flag = fcntl(s->sock_fd, F_GETFL, 0);
645 fcntl(s->sock_fd, F_SETFL, delay_flag);
649 ioctlsocket(s->sock_fd, FIONBIO, (u_long*)&block);
653 socketioctl(s->sock_fd, FIONBIO, (u_long*)&block);
677 if (s->sock_fd < 0)
687 pollfd.fd = s->sock_fd;
702 FD_SET(s->sock_fd, &fds);
706 n = select(s->sock_fd+1, NULL, &fds, NULL, &tv);
708 n = select(s->sock_fd+1, &fds, NULL, NULL, &tv);
730 s->sock_fd = fd;
743 socketioctl(s->sock_fd, 0x80046679, (u_long*)&block);
1447 if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
1659 newfd = accept(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
1685 addr = makesockaddr(s->sock_fd, SAS2SA(&addrbuf),
1802 socketioctl(s->sock_fd, 0x80046679, (u_long*)&block);
1841 res = setsockopt(s->sock_fd, level, optname, (void *)buf, buflen);
1882 res = getsockopt(s->sock_fd, level, optname,
1902 res = getsockopt(s->sock_fd, level, optname,
1933 res = bind(s->sock_fd, SAS2SA(&addrbuf), addrlen);
1958 if ((fd = s->sock_fd) != -1) {
1959 s->sock_fd = -1;
1980 res = connect(s->sock_fd, addr, addrlen);
1994 FD_SET(s->sock_fd, &fds);
1996 FD_SET(s->sock_fd, &fds_exc);
1997 res = select(s->sock_fd+1, NULL, &fds, &fds_exc, &tv);
2002 if (FD_ISSET(s->sock_fd, &fds))
2011 assert(FD_ISSET(s->sock_fd, &fds_exc));
2012 if (0 == getsockopt(s->sock_fd, SOL_SOCKET, SO_ERROR,
2038 (void)getsockopt(s->sock_fd, SOL_SOCKET,
2135 return PyInt_FromLong((long) s->sock_fd);
2137 return PyLong_FromLongLong((PY_LONG_LONG)s->sock_fd);
2156 newfd = dup(s->sock_fd);
2189 res = getsockname(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
2193 return makesockaddr(s->sock_fd, SAS2SA(&addrbuf), addrlen,
2218 res = getpeername(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
2222 return makesockaddr(s->sock_fd, SAS2SA(&addrbuf), addrlen,
2251 res = listen(s->sock_fd, backlog);
2307 if (((fd = _open_osfhandle(s->sock_fd, _O_BINARY)) < 0) ||
2310 if ((fd = dup(s->sock_fd)) < 0 || (fp = fdopen(fd, mode)) == NULL)
2358 outlen = recv(s->sock_fd, cbuf, len, flags);
2389 nread = recv(s->sock_fd, read_buf, segment, flags);
2565 n = recvfrom(s->sock_fd, cbuf, len, flags,
2568 n = recvfrom(s->sock_fd, cbuf, len, flags,
2572 n = recvfrom(s->sock_fd, cbuf, len, flags,
2587 if (!(*addr = makesockaddr(s->sock_fd, SAS2SA(&addrbuf),
2723 n = sendsegmented(s->sock_fd, buf, len, flags);
2725 n = send(s->sock_fd, buf, len, flags);
2773 n = sendsegmented(s->sock_fd, buf, len, flags);
2775 n = send(s->sock_fd, buf, len, flags);
2866 n = sendto(s->sock_fd, buf, len, flags, SAS2SA(&addrbuf), addrlen);
2898 res = shutdown(s->sock_fd, how);
2928 if (WSAIoctl(s->sock_fd, cmd, &option, sizeof(option),
2938 if (WSAIoctl(s->sock_fd, cmd, &ka, sizeof(ka),
3040 if (s->sock_fd != -1)
3041 (void) SOCKETCLOSE(s->sock_fd);
3051 if (s->sock_fd > LONG_MAX) {
3064 (long)s->sock_fd, s->sock_family,
3080 ((PySocketSockObject *)new)->sock_fd = -1;