Module partisan_peer_connection

Wrapper for peer connections that allows transparent usage of plain TCP or TLS/SSL.

Description

Wrapper for peer connections that allows transparent usage of plain TCP or TLS/SSL.

Data Types

connection()

connection() = #connection{socket = gen_tcp:socket() | ssl:sslsocket(), transport = gen_tcp | ssl, control = inet | ssl, monotonic = boolean()}

options()

options() = [ssl:option()]

reason()

reason() = closed | inet:posix()

Function Index

accept/1Wraps 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/1Returns the wrapped socket from within the connection.

Function Details

accept/1

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/1

close(Connection::connection()) -> ok

See also: gen_tcp:close/1, ssl:close/1.

connect/3

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/4

connect(Address::inet:socket_address() | inet:hostname(), Port::inet:port_number(), Options::options(), Timeout::timeout()) -> {ok, connection()} | {error, inet:posix()}

connect/5

connect(Address::inet:socket_address() | inet:hostname(), Port::inet:port_number(), Options::options(), Timeout::timeout(), PartisanOptions::list()) -> {ok, connection()} | {error, inet:posix()}

recv/2

recv(Conn::connection(), Length::integer()) -> {ok, iodata()} | {error, reason()}

See also: gen_tcp:recv/2, ssl:recv/2.

recv/3

recv(Connection::connection(), Length::integer(), Timeout::timeout()) -> {ok, iodata()} | {error, reason()}

See also: gen_tcp:recv/3, ssl:recv/3.

send/2

send(Connection::connection(), Data::iodata()) -> ok | {error, reason()}

See also: gen_tcp:send/2, ssl:send/2.

setopts/2

setopts(Connection::connection(), Options::options()) -> ok | {error, inet:posix()}

See also: inet:setopts/2, ssl:setopts/2.

socket/1

socket(Conn::connection()) -> gen_tcp:socket() | ssl:ssl_socket()

Returns the wrapped socket from within the connection.


Generated by EDoc