generic-server-0.1: Simple generic TCP/IP server

Network.GenericServer

Synopsis

Documentation

genericServerSource

Arguments

:: Int

Port number

-> (Handle -> IO ByteString)

Query reading function

-> (ByteString -> IO ByteString)

Worker function

-> IO () 

Run TCP/IP server with any worker funciton

waitDataSource

Arguments

:: Int

Port number

-> Int

Data size

-> IO ByteString 

Read given amount of bytes from socket

class Server s whereSource

Associated Types

type Request s Source

type Response s Source

wrap :: (a -> IO b) -> s -> a -> IO (b, s)Source

server :: forall s. Server s => s -> Int -> IO ()Source