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, X2::SslFlag) -> ok | {error, Reason}
Closes a socket.
connect(Host, Port, Options, Timeout, X5::SslFlag) -> {ok, Socket} | {error, Reason}
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, X2::SslFlag) -> {ok, Data} | {error, Reason}
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, Request::Data, X3::SslFlag) -> ok | {error, Reason}
Sends data on a socket.
Will use the ssl
module if SslFlag
is set to true
, otherwise the
gen_tcp module.
setopts(Socket, Opts, X3::SslFlag) -> ok | {error, Reason}
Sets options for a socket.
Will use the ssl
module if SslFlag
is set to true
, otherwise the
inets module.
Generated by EDoc, May 17 2017, 09:28:02.