-- 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.2.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 serveOne :: Maybe UserAndGroup -> Server -> IO (ThreadId, MVar ()) serveMany :: Maybe UserAndGroup -> [Server] -> IO [(ThreadId, MVar ())] -- | the functionality of a server type ServerRoutine = (Handle, HostName, PortNumber) -> IO () data UserAndGroup UserAndGroup :: String -> String -> UserAndGroup UserWithDefaultGroup :: String -> UserAndGroup class WaitFor a waitFor :: WaitFor a => a -> IO () instance WaitFor (ThreadId, MVar ()) instance WaitFor a => WaitFor [a] instance WaitFor (MVar a)