Module fusco_sock

This module implements wrappers for socket operations.

Copyright © (C) 1999-2013, Erlang Solutions Ltd

Authors: Oscar Hellström (oscar@hellstrom.st), Diana Parra Corbacho (diana.corbacho@erlang-solutions.com).

Description

This module implements wrappers for socket operations.

Makes it possible to have the same interface to ssl and tcp sockets.

Function Index

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.

Function Details

close/2

close(Socket::socket(), X2::boolean()) -> ok | {error, atom()}

Closes a socket.

connect/5

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

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

recv(Socket::socket(), X2::boolean(), Timeout::timeout()) -> {ok, any()} | {error, atom()} | {error, {http_error, string()}}

send/3

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

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