Commit 73b15c1b authored by Max Kellermann's avatar Max Kellermann

net/SocketDescriptor: socketpair() is unavailable on Windows

parent b1806044
...@@ -131,6 +131,8 @@ SocketDescriptor::CreateNonBlock(int domain, int type, int protocol) ...@@ -131,6 +131,8 @@ SocketDescriptor::CreateNonBlock(int domain, int type, int protocol)
return true; return true;
} }
#ifndef _WIN32
bool bool
SocketDescriptor::CreateSocketPair(int domain, int type, int protocol, SocketDescriptor::CreateSocketPair(int domain, int type, int protocol,
SocketDescriptor &a, SocketDescriptor &b) SocketDescriptor &a, SocketDescriptor &b)
...@@ -168,6 +170,8 @@ SocketDescriptor::CreateSocketPairNonBlock(int domain, int type, int protocol, ...@@ -168,6 +170,8 @@ SocketDescriptor::CreateSocketPairNonBlock(int domain, int type, int protocol,
return true; return true;
} }
#endif
int int
SocketDescriptor::GetError() SocketDescriptor::GetError()
{ {
......
...@@ -125,10 +125,12 @@ public: ...@@ -125,10 +125,12 @@ public:
*/ */
bool CreateNonBlock(int domain, int type, int protocol); bool CreateNonBlock(int domain, int type, int protocol);
#ifndef _WIN32
static bool CreateSocketPair(int domain, int type, int protocol, static bool CreateSocketPair(int domain, int type, int protocol,
SocketDescriptor &a, SocketDescriptor &b); SocketDescriptor &a, SocketDescriptor &b);
static bool CreateSocketPairNonBlock(int domain, int type, int protocol, static bool CreateSocketPairNonBlock(int domain, int type, int protocol,
SocketDescriptor &a, SocketDescriptor &b); SocketDescriptor &a, SocketDescriptor &b);
#endif
int GetError(); int GetError();
......
...@@ -83,6 +83,7 @@ public: ...@@ -83,6 +83,7 @@ public:
return UniqueSocketDescriptor(SocketDescriptor::AcceptNonBlock(address)); return UniqueSocketDescriptor(SocketDescriptor::AcceptNonBlock(address));
} }
#ifndef _WIN32
static bool CreateSocketPair(int domain, int type, int protocol, static bool CreateSocketPair(int domain, int type, int protocol,
UniqueSocketDescriptor &a, UniqueSocketDescriptor &a,
UniqueSocketDescriptor &b) { UniqueSocketDescriptor &b) {
...@@ -98,6 +99,7 @@ public: ...@@ -98,6 +99,7 @@ public:
protocol, protocol,
a, b); a, b);
} }
#endif
}; };
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment