Copyright © (C) 2015 ACK CYFRONET AGH This software is released under the MIT license cited in 'LICENSE.md'.
Authors: Konrad Zemek.
abstract datatype: acceptor()
der_encoded() = binary()
option() = {packet, raw | 0 | 1 | 2 | 4} | {active, boolean() | once} | {exit_on_close, boolean()}
pem_encoded() = binary()
abstract datatype: socket()
ssl_option() = {verify_type, verify_none | verify_peer} | {fail_if_no_peer_cert, boolean()} | {verify_client_once, boolean()} | {rfc2818_verification_hostname, str()} | {cacerts, [pem_encoded()]} | {crls, [pem_encoded()]} | {certfile, str()} | {keyfile, str()} | {chain, [pem_encoded()]}
str() = binary() | string()
accept/1 | Equivalent to accept(Acceptor, infinity). |
accept/2 | Accepts an incoming connection on an acceptor. |
certificate_chain/1 | Returns a DER-encoded chain of peer certificates. |
close/1 | Gracefully closes the socket. |
connect/3 | Equivalent to connect(Host, Port, Opts, infinity). |
connect/4 | Opens an ssl connection to Host, Port. |
controlling_process/2 | Assigns a new controlling process to the socket. |
handshake/1 | Equivalent to handshake(Socket, infinity). |
handshake/2 | Performs a TLS handshake on the new TCP socket. |
listen/2 | Creates an acceptor (listen socket). |
peercert/1 | Returns a DER-encoded public certificate of the peer. |
peername/1 | Returns the address and port number of the peer. |
recv/2 | Equivalent to recv(Socket, Size, infinity). |
recv/3 | Receives a packet from a socket in passive mode. |
send/2 | Writes Data to Socket. |
setopts/2 | Sets options according to Options for the socket Socket. |
shutdown/2 | Shuts down the connection in one or two directions. |
sockname/1 | Returns the address and port number of the socket. |
accept(Acceptor::acceptor()) -> {ok, Socket::socket()} | {error, Reason::timeout | atom()}
Equivalent to accept(Acceptor, infinity).
accept(Acceptor::acceptor(), Timeout::timeout()) -> {ok, Socket::socket()} | {error, Reason::timeout | atom()}
Accepts an incoming connection on an acceptor. The returned socket should be passed to ssl2:handshake to establish the secure connection.
certificate_chain(Socket::socket()) -> {ok, [der_encoded()]} | {error, Reason::atom()}
Returns a DER-encoded chain of peer certificates.
close(Socket::socket()) -> ok | {error, Reason::atom()}
Gracefully closes the socket.
connect(Host::str(), Port::inet:port_number(), Opts::[option() | ssl_option()]) -> {ok, Socket::socket()} | {error, Reason::atom()}
Equivalent to connect(Host, Port, Opts, infinity).
connect(Host::str(), Port::inet:port_number(), Opts::[option() | ssl_option()], Timeout::timeout()) -> {ok, Socket::socket()} | {error, Reason::atom()}
Opens an ssl connection to Host, Port.
controlling_process(Socket::socket(), NewControllingProcess::pid()) -> ok
Assigns a new controlling process to the socket. A controlling process receives all messages from the socket.
handshake(Socket::socket()) -> ok | {error, Reason::atom()}
Equivalent to handshake(Socket, infinity).
handshake(Socket::socket(), Timeout::timeout()) -> ok | {error, Reason::timeout | any()}
Performs a TLS handshake on the new TCP socket. The socket should be created by ssl2:accept .
listen(Port::inet:port_number(), Opts::[ssl_option()]) -> {ok, Acceptor::acceptor()} | {error, Reason::atom()}
Creates an acceptor (listen socket).
peercert(Socket::socket()) -> {ok, der_encoded()} | {error, Reason::no_peer_certificate | atom()}
Returns a DER-encoded public certificate of the peer.
peername(Socket::socket()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, Reason::atom()}
Returns the address and port number of the peer.
recv(Socket::socket(), Size::non_neg_integer()) -> {ok, binary()} | {error, Reason::closed | timeout | atom()}
Equivalent to recv(Socket, Size, infinity).
recv(Socket::socket(), Size::non_neg_integer(), Timeout::timeout()) -> {ok, binary()} | {error, Reason::closed | timeout | atom()}
Receives a packet from a socket in passive mode. If the socket is closed, returns {error, closed}.
send(Socket::socket(), Data::iodata()) -> ok | {error, Reason::closed | atom()}
Writes Data to Socket. If the socket is closed, returns {error, closed}.
Sets options according to Options for the socket Socket.
shutdown(Socket::socket(), Type::read | write | read_write) -> ok | {error, Reason::atom()}
Shuts down the connection in one or two directions. To be able to handle that the peer has done a shutdown on the write side, the {exit_on_close, false} option is useful.
sockname(SocketOrAcceptor::socket() | acceptor()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, Reason::atom()}
Returns the address and port number of the socket.
Generated by EDoc, Jun 12 2016, 00:01:17.