commsec-keyexchange-0.3.3: Key agreement for commsec.

Safe HaskellNone
LanguageHaskell98

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).

bind :: Socket -> SockAddr -> IO ()

Bind the socket to an address. The socket must not already be bound. The Family passed to bind must be the same as that passed to socket. If the special port number aNY_PORT is passed then the system assigns the next available use port.

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