Copyright © (C) 1999-2013, Erlang Solutions Ltd
Authors: Oscar Hellström (oscar@hellstrom.st), Diana Parra Corbacho (diana.corbacho@erlang-solutions.com).
This module implements wrappers for socket operations.
Makes it possible to have the same interface to ssl and tcp sockets.close/2 | Closes a socket. |
connect/5 |
Connects to Host and Port . |
recv/2 |
Reads available bytes from Socket . |
recv/3 | |
send/3 | Sends data on a socket. |
setopts/3 | Sets options for a socket. |
close(Socket::socket(), X2::boolean()) -> ok | {error, atom()}
Closes a socket.
connect(Host::host(), Port::integer(), Options::socket_options(), Timeout::timeout(), X5::boolean()) -> {ok, socket()} | {error, atom()}
Connects to Host
and Port
.
Will use the ssl
module if SslFlag
is true
and gen_tcp otherwise.
Options
are the normal gen_tcp
or ssl
Options.
recv(Socket::socket(), X2::boolean()) -> {ok, any()} | {error, atom()} | {error, {http_error, string()}}
Reads available bytes from Socket
.
Will block untill data is available on the socket and return the first
packet.
recv(Socket::socket(), X2::boolean(), Timeout::timeout()) -> {ok, any()} | {error, atom()} | {error, {http_error, string()}}
send(Socket::socket(), Request::iolist() | binary(), X3::boolean()) -> ok | {error, atom()}
Sends data on a socket.
Will use the ssl
module if SslFlag
is set to true
, otherwise the
gen_tcp module.
setopts(Socket::socket(), Opts::list(), X3::boolean()) -> ok | {error, atom()}
Sets options for a socket.
Will use the ssl
module if SslFlag
is set to true
, otherwise the
inets module.
Generated by EDoc