@@ -126,6 +126,8 @@ getPeerEid _ = return (0, 0)
126
126
{-# Deprecated getPeerEid "Use getPeerCredential instead" #-}
127
127
128
128
-- | Whether or not UNIX-domain sockets are available.
129
+ -- 'AF_UNIX' is supported on Windows since 3.1.3.0.
130
+ -- So, this variable is 'True` on all platforms.
129
131
--
130
132
-- Since 2.7.0.0.
131
133
isUnixDomainSocketAvailable :: Bool
@@ -139,8 +141,7 @@ instance SocketAddress NullSockAddr where
139
141
pokeSocketAddress _ _ = return ()
140
142
141
143
-- | Send a file descriptor over a UNIX-domain socket.
142
- -- Use this function in the case where 'isUnixDomainSocketAvailable' is
143
- -- 'True'.
144
+ -- This function does not work on Windows.
144
145
sendFd :: Socket -> CInt -> IO ()
145
146
sendFd s outfd = void $ allocaBytes dummyBufSize $ \ buf -> do
146
147
let cmsg = encodeCmsg $ Fd outfd
@@ -151,8 +152,7 @@ sendFd s outfd = void $ allocaBytes dummyBufSize $ \buf -> do
151
152
-- | Receive a file descriptor over a UNIX-domain socket. Note that the resulting
152
153
-- file descriptor may have to be put into non-blocking mode in order to be
153
154
-- used safely. See 'setNonBlockIfNeeded'.
154
- -- Use this function in the case where 'isUnixDomainSocketAvailable' is
155
- -- 'True'.
155
+ -- This function does not work on Windows.
156
156
recvFd :: Socket -> IO CInt
157
157
recvFd s = allocaBytes dummyBufSize $ \ buf -> do
158
158
(NullSockAddr , _, cmsgs, _) <- recvBufMsg s [(buf,dummyBufSize)] 32 mempty
@@ -163,9 +163,8 @@ recvFd s = allocaBytes dummyBufSize $ \buf -> do
163
163
dummyBufSize = 16
164
164
165
165
-- | Build a pair of connected socket objects.
166
- -- For portability, use this function in the case
167
- -- where 'isUnixDomainSocketAvailable' is 'True'
168
- -- and specify 'AF_UNIX' to the first argument.
166
+ -- On Windows, this function emulates socketpair() using
167
+ -- 'AF_UNIX' and a temporary file will remain.
169
168
socketPair :: Family -- Family Name (usually AF_UNIX)
170
169
-> SocketType -- Socket Type (usually Stream)
171
170
-> ProtocolNumber -- Protocol Number
0 commit comments