Safe Haskell | None |
---|---|
Language | Haskell98 |
A channel module with transparent network communication.
- data NetSend t
- data NetRecv t
- localHost :: IO [Char]
- newNetChan :: Binary t => IO (NetRecv t, NetSend t)
- newNetSend :: HostName -> IO (NetSend t)
- newNetRecv :: Binary t => IO (NetRecv t)
- send :: Binary t => NetSend t -> t -> IO ()
- receive :: NetRecv t -> IO ByteString
- recv :: Binary t => NetRecv t -> IO t
- recvSend :: NetRecv (NetSend t) -> IO (NetSend t)
- sendRecv :: NetSend (NetRecv t) -> NetRecv t -> IO ()
- recvRecv :: Binary t => NetRecv (NetRecv t) -> IO (NetRecv t)
- activateSend :: NetSend t -> IO (NetSend t)
- activateRecv :: Binary t => NetRecv t -> IO (NetRecv t)
- data Auth t
- authServer :: Binary t => (t -> IO ()) -> NetRecv (Auth t) -> NetSend ByteString -> PublicKey -> IO ()
- authClient :: Binary t => NetRecv ByteString -> NetSend (Auth t) -> PrivateKey -> IO (t -> IO ())
- example :: IO ()
Documentation
newNetChan :: Binary t => IO (NetRecv t, NetSend t) Source
Creates a new channel, with receive and send ends.
newNetSend :: HostName -> IO (NetSend t) Source
Open a channel to another host
newNetRecv :: Binary t => IO (NetRecv t) Source
Creates a receive end of this host's channel. Type unsafe!
receive :: NetRecv t -> IO ByteString Source
recvSend :: NetRecv (NetSend t) -> IO (NetSend t) Source
Receives the send end of a channel, on a channel.
sendRecv :: NetSend (NetRecv t) -> NetRecv t -> IO () Source
Sends the receive end of a channel, on a channel.
recvRecv :: Binary t => NetRecv (NetRecv t) -> IO (NetRecv t) Source
Receives the receive end of a channel, on a channel.
activateSend :: NetSend t -> IO (NetSend t) Source
authServer :: Binary t => (t -> IO ()) -> NetRecv (Auth t) -> NetSend ByteString -> PublicKey -> IO () Source
Remote exercise of authority. Commands are transmitted in the clear, but authenticated.
auth - The authority to be served (runs on a separate thread).
r - The receive end from the host.
s - The send end to the host.
publicKey - The public key of the intended recipient.
authClient :: Binary t => NetRecv ByteString -> NetSend (Auth t) -> PrivateKey -> IO (t -> IO ()) Source
privateKey - The private key for this host.
Returns a function that can be used to send messages.