bert-1.2.1: BERT implementation

Safe HaskellNone

Network.BERT.Client

Contents

Description

BERT-RPC client (http://bert-rpc.org/). This implements the client RPC call logic.

Synopsis

Example

 t <- tcpClient "localhost" 8080
 r <- call t "calc" "add" ([123, 3000]::[Int])
 case r of
   Right res -> print (res :: Int)
   Left _    -> putStrLn "error"

call :: (BERT a, BERT b, Transport t) => t -> String -> String -> [a] -> Call bSource

Call the {mod, func, args} synchronously on the endpoint defined by transport, returning the results of the call or an error.

tcpClient :: HostName -> PortNumber -> IO TCPSource

Establish a connection to the TCP server and return the resulting transport. It can be used to make multiple requests.

type Call a = IO (Either Error a)Source

Convenience type for call