Modulesemaphore-compat-2.0.1Haskell2010
System.Semaphore.Internal.DomainSocket
FFI glue code for Unix domain sockets.
- 1 type
- 6 values
- Packagesemaphore-compat-2.0.1
- Exports7
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceDomainSocket.hs
Open a socket in non blocking mode (O_NONBLOCK)
Block until either a client connects or the cancel fd is written to.
Relies on cooperative cancellation implemented in hs_poll_accept using
poll(2) + accept(2) via safe FFI to avoid GHC #27110 and #27113.
Must be called from a masked context. The caller is responsible for installing an exception handler that closes all 3 fds (inputs and outputs).
Result of pollAcceptSocket.
Constructors
AcceptedFd !FdA client connected; here is the fd.
AcceptCancelledThe cancel pipe was signalled.
Read a single byte from a file descriptor. Throws an EOF IOError if the peer has disconnected.
Write a single byte to a file descriptor.
Shut down a socket for both reading and writing. A concurrent fdReadByte on the same fd will return immediately Used to cancel threads blocked in read()