Throw an IOError corresponding to the current socket error.
Modulenetwork-3.2.8.0Haskell2010
Network.Socket.Internal
A module containing semi-public Network.Socket internals. Modules which extend the Network.Socket module will need to use this module while ideally most users will be able to make do with the public interface.
- 1 type
- 11 values
- Packagenetwork-3.2.8.0
- Exports12
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceInternal.hs
Socket error functions
2 declarationsLike throwSocketError, but the error code is supplied as an argument.
On Windows, do not use errno. Use a system error code instead.
Guards for socket operations that may fail
4 declarationsThrow an IOError corresponding to the current socket error if
the IO action returns a result of -1. Discards the result of the
IO action after error handling.
Throw an IOError corresponding to the current socket error if
the IO action returns a result of -1, but retries in case of an
interrupted operation.
Throw an IOError corresponding to the current socket error if
the IO action returns a result of -1, but retries in case of an
interrupted operation. Discards the result of the IO action after
error handling.
Throw an IOError corresponding to the current socket error if
the IO action returns a result of -1, but retries in case of an
interrupted operation. Checks for operations that would block and
executes an alternative action before retrying in that case.
Guards that wait and retry if the operation would block
These guards are based on throwSocketErrorIfMinus1RetryMayBlock.
They wait for socket readiness if the action fails with EWOULDBLOCK
or similar.
Like throwSocketErrorIfMinus1Retry, but if the action fails with
EWOULDBLOCK or similar, wait for the socket to be read-ready,
and try again.
Like throwSocketErrorIfMinus1Retry, but if the action fails with
EWOULDBLOCK or similar, wait for the socket to be read-ready,
and try again. If it fails with the error the user was expecting then
ignore the error
Like throwSocketErrorIfMinus1Retry, but if the action fails with
EWOULDBLOCK or similar, wait for the socket to be write-ready,
and try again.
Initialization
1 declarationWith older versions of the network library (version 2.6.0.2 or earlier)
on Windows operating systems,
the networking subsystem must be initialised using withSocketsDo before
any networking operations can be used. eg.
main = withSocketsDo $ do {...}It is fine to nest calls to withSocketsDo, and to perform networking operations after withSocketsDo has returned.
withSocketsDo is not necessary for the current network library. However, for compatibility with older versions on Windows, it is good practice to always call withSocketsDo (it's very cheap).
Null socket address type
1 declarationA null SocketAddress for situations where a socket address parameter is optional.
Instances1SocketAddress
SocketAddress NullSockAddrDefined in network-3.2.8.0 · Network.Socket.Types
Low-level helpers
1 declarationZero a structure.