libraft-0.5.0.0: Raft consensus algorithm

Safe HaskellNone
LanguageHaskell2010

Examples.Raft.Socket.Common

Synopsis

Documentation

hostPortToNid :: (HostName, ServiceName) -> NodeId Source #

Convert a host and a port to a valid NodeId

nidToHostPort :: NodeId -> (HostName, ServiceName) Source #

Retrieve the host and port from a valid NodeId

getFreePort :: IO PortNumber Source #

Get a free port number.

recvSerialized :: Serialize a => Socket -> IO (Maybe a) Source #

Receive bytes on a socket until an entire message can be decoded. This function fixes the deserialization of the bytes sent on the socket to the implementation of the Serialize typeclass.