-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A light abstraction over sockets & co. for servers -- -- With these routines it is very easy to write a server, have it accept -- connections on multiple ports via IP4, IP6 or unix sockets and -- associate each of these bindings with a server routine. @package network-server @version 0.1.0 module Network.Server -- | make an IP Address: (127,0,0,1) is the localhost ipAddress :: (Word8, Word8, Word8, Word8) -> HostAddress -- | the specification of a serving process data Server Server :: SockAddr -> SocketType -> ServerRoutine -> Server serverAddr :: Server -> SockAddr serverTyp :: Server -> SocketType serverRoutine :: Server -> ServerRoutine -- | Start one server acception connections and return immediatly. You can -- wait for the server thread by reading the MVar serveNoBlock :: Server -> IO (ThreadId, MVar ()) -- | like serveNoBlock, but wait for the server thread to finish serve :: Server -> IO () -- | Start a list of servers and return immediatly. multiServeNoBlock :: [Server] -> IO [(ThreadId, MVar ())] -- | the functionality of a server type ServerRoutine = (Handle, HostName, PortNumber) -> IO () -- | Start a list of servers and wait for all server threads multiServe :: [Server] -> IO ()