hackney_http_connect (hackney v1.24.1)

View Source

Summary

Functions

Close a socks5 socket.

Assign a new controlling process Pid to Socket.

Atoms used to identify messages in {active, once | true} mode.

Return the address and port for the other end of a connection.

Receive a packet from a socket in passive mode.

Send a packet on a socket.

Set one or more options for a socket.

Immediately close a socket in one or two directions.

Get the local address and port of a socket

Types

http_socket/0

-type http_socket() :: {atom(), inet:socket()}.

Functions

close(_)

-spec close(http_socket()) -> ok.

Close a socks5 socket.

See also: gen_tcp:close/1.

connect(ProxyHost, ProxyPort, Opts)

connect(ProxyHost, ProxyPort, Opts, Timeout)

controlling_process(_, Pid)

-spec controlling_process(http_socket(), pid()) -> ok | {error, closed | not_owner | atom()}.

Assign a new controlling process Pid to Socket.

See also: gen_tcp:controlling_process/2.

messages(_)

Atoms used to identify messages in {active, once | true} mode.

peername(_)

-spec peername(http_socket()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, atom()}.

Return the address and port for the other end of a connection.

See also: inet:peername/1.

recv(Socket, Length)

recv(_, Length, Timeout)

-spec recv(http_socket(), non_neg_integer(), timeout()) -> {ok, any()} | {error, closed | atom()}.

Receive a packet from a socket in passive mode.

See also: gen_tcp:recv/3.

send(_, Packet)

-spec send(http_socket(), iolist()) -> ok | {error, atom()}.

Send a packet on a socket.

See also: gen_tcp:send/2.

setopts(_, Opts)

-spec setopts(http_socket(), list()) -> ok | {error, atom()}.

Set one or more options for a socket.

See also: inet:setopts/2.

shutdown(_, How)

-spec shutdown(http_socket(), read | write | read_write) -> ok.

Immediately close a socket in one or two directions.

See also: gen_tcp:shutdown/2.

sockname(_)

-spec sockname(http_socket()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, atom()}.

Get the local address and port of a socket

See also: inet:sockname/1.