1 #pragma once
2
3 #include <torch/csrc/distributed/c10d/Utils.hpp>
4
5 namespace c10d::tcputil {
6
7 #define CONNECT_SOCKET_OFFSET 1
8
poll(struct pollfd * fdArray,unsigned long fds,int timeout)9 inline int poll(struct pollfd* fdArray, unsigned long fds, int timeout) {
10 return WSAPoll(fdArray, fds, timeout);
11 }
12
addPollfd(std::vector<struct pollfd> & fds,int socket,short events)13 inline void addPollfd(
14 std::vector<struct pollfd>& fds,
15 int socket,
16 short events) {
17 fds.push_back({(SOCKET)socket, events});
18 }
19
getPollfd(int socket,short events)20 inline struct ::pollfd getPollfd(int socket, short events) {
21 struct ::pollfd res = {(SOCKET)socket, events};
22 return res;
23 }
24
25 } // namespace c10d::tcputil
26