|
|
|
|
|
|
| Synopsis |
|
|
|
|
| Address
|
|
|
|
|
| Constructors | | IP HostName Int | Host name and port, either IPv4 or IPv6.
| | IPv4 HostName Int | Host name and port, only IPv4.
| | IPv6 HostName Int | Host name and port, only IPv6
| | Unix FilePath | Local unix socket, not supported on Windows.
|
| Instances | |
|
|
| Stream clients
|
|
|
| Open a stream (tcp) socket for the given block and close it afterwards.
|
|
|
| Open a stream (tcp) socket.
|
|
| Datagram clients
|
|
|
| Open a datagram (udp) socket.
|
|
|
| Open a datagram (udp) socket for the given block and close it afterwards.
|
|
| class StringLike string | Source |
|
| Instances | |
|
|
|
| Receive one chunk with given maximum size
|
|
|
| Send the string as one chunk
|
|
|
| Close the socket specified.
|
|
| Servers
|
|
|
| Constructors | | ServerSpec | | | address :: Address | Address for the server. Use hostname "" to bind to all interfaces.
| | reverseAddress :: Reverse | Should the address of connecting clients be suplied numerically or as a name to server function.
| | threading :: Threading | Handle requests Inline or Threaded.
| | closeConnection :: Bool | Close the client connection automatically after the ServerFun finishes.
| | recvSize :: Int | Buffer size for receiving datagrams.
|
|
|
|
|
|
| Default server specification
|
|
|
| Constructors | | Threaded | Run each request in a separate thread without blocking the server loop.
| | Inline | Run each request inline inside the request loop.
|
|
|
|
|
| Constructors | | ReverseNumeric | Use numeric addresses for peers.
| | ReverseName | Resolve reverse names if possible for peers.
|
|
|
|
|
| Run a stream (tcp) server. The function does not block, use sleepForever if that is desired.
|
|
|
| :: StringLike packet | | | => ServerSpec | Server specification
| | -> packet -> Address -> IO [packet] | The server function is given a received packet and the Address of the peer. It returns a list of reply packets to send to that peer. Note that the list elements are invidual packets, not concatenated together.
| | -> IO [ThreadId] | ThreadIds of the server listener processes.
| | Run a datagram (udp) server. The function does not block, use sleepForever if that is desired.
|
|
|
|
| Sleep forever. Useful after a server.
|
|
| Other
|
|
|
| Get the current hostname.
|
|
|
|
| Produced by Haddock version 2.4.2 |