-
Notifications
You must be signed in to change notification settings - Fork 205
Expand file tree
/
Copy pathCbits.hsc
More file actions
37 lines (33 loc) · 821 Bytes
/
Cbits.hsc
File metadata and controls
37 lines (33 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module Network.Socket.Cbits where
#include "HsNet.h"
import Network.Socket.Imports
-- | This is the value of SOMAXCONN, typically 128.
-- 128 is good enough for normal network servers but
-- is too small for high performance servers.
--
-- TODO what if not present
maxListenQueue :: Int
#ifdef SOMAXCONN
maxListenQueue = #const SOMAXCONN
#else
maxListenQueue = 1
#endif
#if defined(mingw32_HOST_OS)
wsaNotInitialized :: CInt
wsaNotInitialized = #const WSANOTINITIALISED
#else
fGetFd :: CInt
fGetFd = #const F_GETFD
fGetFl :: CInt
fGetFl = #const F_GETFL
fdCloexec :: CInt
fdCloexec = #const FD_CLOEXEC
oNonBlock :: CInt
oNonBlock = #const O_NONBLOCK
# if defined(HAVE_ADVANCED_SOCKET_FLAGS)
sockNonBlock :: CInt
sockNonBlock = #const SOCK_NONBLOCK
sockCloexec :: CInt
sockCloexec = #const SOCK_CLOEXEC
# endif
#endif