|
Network.Socket | Portability | portable
| Stability | provisional
| Maintainer | libraries@haskell.org
|
|
|
|
|
|
Description |
The Network.Socket module is for when you want full control over
sockets. Essentially the entire C socket API is exposed through
this module; in general the operations follow the behaviour of the C
functions of the same name (consult your favourite Unix networking book).
A higher level interface to networking operations is provided
through the module Network.
|
|
Synopsis |
|
|
|
|
Types
|
|
|
Constructors | | Instances | |
|
|
|
This data type might have different constructors depending on
what is supported by the operating system.
| Constructors | AF_UNSPEC | | AF_UNIX | | AF_INET | | AF_INET6 | | AF_IMPLINK | | AF_PUP | | AF_CHAOS | | AF_NS | | AF_ECMA | | AF_DATAKIT | | AF_CCITT | | AF_SNA | | AF_DECnet | | AF_DLI | | AF_LAT | | AF_HYLINK | | AF_APPLETALK | | AF_NETBIOS | | AF_ISO | | AF_OSI | | AF_IPX | |
| Instances | |
|
|
|
Socket Types.
This data type might have different constructors depending on what is
supported by the operating system.
| Constructors | NoSocketType | | Stream | | Datagram | | Raw | | RDM | | SeqPacket | |
| Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | NotConnected | | Bound | | Listening | | Connected | | ConvertedToHandle | |
| Instances | |
|
|
|
|
|
Constructors | ShutdownReceive | | ShutdownSend | | ShutdownBoth | |
| Instances | |
|
|
|
|
|
This is the default protocol for a given service.
|
|
|
Constructors | | Instances | |
|
|
Address operations
|
|
|
|
|
|
Socket Operations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
turns a Socket into an Handle. By default, the new handle is
unbuffered. Use hSetBuffering to change the buffering.
Note that since a Handle is automatically closed by a finalizer
when it is no longer referenced, you should avoid doing any more
operations on the Socket after calling socketToHandle. To
close the Socket after socketToHandle, call hClose
on the Handle.
|
|
|
NOTE: blocking on Windows unless you compile with -threaded (see
GHC ticket #1129)
|
|
|
|
|
NOTE: blocking on Windows unless you compile with -threaded (see
GHC ticket #1129)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Closes a socket
|
|
Predicates on sockets
|
|
|
|
|
|
|
|
|
|
|
|
Socket options
|
|
|
Constructors | DummySocketOption__ | | Debug | | ReuseAddr | | Type | | SoError | | DontRoute | | Broadcast | | SendBuffer | | RecvBuffer | | KeepAlive | | OOBInline | | NoDelay | | Linger | | RecvLowWater | | SendLowWater | | RecvTimeOut | | SendTimeOut | | UseLoopBack | |
| Instances | |
|
|
|
|
|
|
File descriptor transmission
|
|
Special Constants
|
|
|
|
|
The IPv4 wild card address.
|
|
|
|
|
|
|
|
Initialisation
|
|
|
On Windows operating systems, the networking subsystem has to be
initialised using withSocketsDo before any networking operations can
be used. eg.
main = withSocketsDo $ do {...}
Although this is only strictly necessary on Windows platforms, it is
harmless on other platforms, so for portability it is good practice to
use it all the time.
|
|
Very low level operations
|
|
|
|
|
|
Internal
|
|
The following are exported ONLY for use in the BSD module and
should not be used anywhere else.
|
|
|
|
|
|
|
|
|
|
Produced by Haddock version 2.4.2 |