connection() = #connection{socket = gen_tcp:socket() | ssl:sslsocket(), transport = gen_tcp | ssl, control = inet | ssl, monotonic = boolean()}
options() = [ssl:option()]
reason() = closed | inet:posix()
| accept/1 | Wraps a TCP socket with the appropriate information for transceiving on and controlling the socket later. |
| close/1 | |
| connect/3 | |
| connect/4 | |
| connect/5 | |
| recv/2 | |
| recv/3 | |
| send/2 | |
| setopts/2 | |
| socket/1 | Returns the wrapped socket from within the connection. |
accept(TCPSocket::gen_tcp:socket()) -> connection()
Wraps a TCP socket with the appropriate information for transceiving on and controlling the socket later. If TLS/SSL is enabled, this performs the socket upgrade/negotiation before returning the wrapped socket.
close(Connection::connection()) -> ok
See also: gen_tcp:close/1, ssl:close/1.
connect(Address::inet:socket_address() | inet:hostname(), Port::inet:port_number(), Options::options()) -> {ok, connection()} | {error, inet:posix()}
See also: gen_tcp:connect/3, ssl:connect/3.
connect(Address::inet:socket_address() | inet:hostname(), Port::inet:port_number(), Options::options(), Timeout::timeout()) -> {ok, connection()} | {error, inet:posix()}
connect(Address::inet:socket_address() | inet:hostname(), Port::inet:port_number(), Options::options(), Timeout::timeout(), PartisanOptions::list()) -> {ok, connection()} | {error, inet:posix()}
recv(Conn::connection(), Length::integer()) -> {ok, iodata()} | {error, reason()}
See also: gen_tcp:recv/2, ssl:recv/2.
recv(Connection::connection(), Length::integer(), Timeout::timeout()) -> {ok, iodata()} | {error, reason()}
See also: gen_tcp:recv/3, ssl:recv/3.
send(Connection::connection(), Data::iodata()) -> ok | {error, reason()}
See also: gen_tcp:send/2, ssl:send/2.
setopts(Connection::connection(), Options::options()) -> ok | {error, inet:posix()}
See also: inet:setopts/2, ssl:setopts/2.
socket(Conn::connection()) -> gen_tcp:socket() | ssl:ssl_socket()
Returns the wrapped socket from within the connection.
Generated by EDoc