Safe Haskell | None |
---|---|
Language | Haskell98 |
Network.CommSec.KeyExchange.Socket
- connect :: Socket -> SockAddr -> [PublicKey] -> PrivateKey -> IO (Maybe (PublicKey, Connection))
- accept :: Socket -> [PublicKey] -> PrivateKey -> IO (Maybe (PublicKey, Connection))
- listen :: Socket -> Int -> IO ()
- bind :: Socket -> SockAddr -> IO ()
- socket :: Family -> SocketType -> ProtocolNumber -> IO Socket
- send :: Connection -> ByteString -> IO ()
- recv :: Connection -> IO ByteString
- data Connection :: *
- close :: Connection -> IO ()
Documentation
connect :: Socket -> SockAddr -> [PublicKey] -> PrivateKey -> IO (Maybe (PublicKey, Connection)) Source
accept :: Socket -> [PublicKey] -> PrivateKey -> IO (Maybe (PublicKey, Connection)) Source
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.
recv :: Connection -> IO ByteString
data Connection :: *
A connection is a secure bidirectional communication channel.
close :: Connection -> IO ()
Close a connection