commsec-keyexchange-0.2: Key agreement for commsec.

Safe HaskellNone

Network.CommSec.KeyExchange.Socket

Synopsis

Documentation

listen :: Socket -> Int -> IO ()

Listen for connections made to the socket. The second argument specifies the maximum number of queued connections and should be at least 1; the maximum value is system-dependent (usually 5).

socket :: Family -> SocketType -> ProtocolNumber -> IO Socket

Create a new socket using the given address family, socket type and protocol number. The address family is usually AF_INET, AF_INET6, or AF_UNIX. The socket type is usually Stream or Datagram. The protocol number is usually defaultProtocol. If AF_INET6 is used, the IPv6Only socket option is set to 0 so that both IPv4 and IPv6 can be handled with one socket.

send :: Connection -> ByteString -> IO ()

Send a datagram, first encrypting it, using the given secure connection.

data Connection

A connection is a secure bidirectional communication channel.

close :: Connection -> IO ()

Close a connection