network-server-0.1.0: A light abstraction over sockets & co. for servers




ipAddress :: (Word8, Word8, Word8, Word8) -> HostAddressSource

make an IP Address: (127,0,0,1) is the localhost

data Server Source

the specification of a serving process

serveNoBlock :: Server -> IO (ThreadId, MVar ())Source

Start one server acception connections and return immediatly. You can wait for the server thread by reading the MVar

serve :: Server -> IO ()Source

like serveNoBlock, but wait for the server thread to finish

multiServeNoBlock :: [Server] -> IO [(ThreadId, MVar ())]Source

Start a list of servers and return immediatly.

type ServerRoutine = (Handle, HostName, PortNumber) -> IO ()Source

the functionality of a server

multiServe :: [Server] -> IO ()Source

Start a list of servers and wait for all server threads