bert-1.2.2.4: BERT implementation

Safe HaskellNone
LanguageHaskell2010

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 b Source

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 TCP Source

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