Safe Haskell | None |
---|---|
Language | Haskell2010 |
ONC RPC Client interface. Handles RPC client protocol layer. Clients are fully thread-safe, allowing multiple outstanding requests, and automatically reconnect on error. Currently error messages are just written to stdout.
- data ClientServer = ClientServerPort {}
- data Client
- openClient :: ClientServer -> IO Client
- closeClient :: Client -> IO ()
- clientCall :: (XDR a, XDR r) => Client -> Call a r -> IO (Reply r)
- setClientAuth :: Auth -> Auth -> Client -> Client
- rpcCall :: (XDR a, XDR r) => Client -> Procedure a r -> a -> IO r
Documentation
data ClientServer Source #
How to connect to an RPC server. Currently only TCP connections to pre-defined ports are supported (no portmap).
ClientServerPort | a known service by host/port, currently only TCP |
|
openClient :: ClientServer -> IO Client Source #
Create a new RPC client to the given server.
This client must be destroyed with closeClient
when done.
closeClient :: Client -> IO () Source #
clientCall :: (XDR a, XDR r) => Client -> Call a r -> IO (Reply r) Source #
Send a call message using an open client, and wait for a reply, returning ReplyFail
on protocol error.
The request will be automatically retried until a response is received.
rpcCall :: (XDR a, XDR r) => Client -> Procedure a r -> a -> IO r Source #
Make an RPC request.
It waits for a response, retrying as necessary, or throws the RPCException
, ReplyException
, on any failure.
This uses the credentials set by setClientAuth
.
If you need to retrieve the auth verifier, use clientCall
.