View Source DiodeClient.Transport (Diode Client v1.2.0)

DiodeClient Transport interface for use with Cowboy2 Adapter and :hackeny. Potentially more depending on interface compatibility

Example using hackney to make http requests via Diode:

{:ok, ref} = :hackney.connect(DiodeClient.Transport, address, port)
request = {:get, path, [], ""}
{:ok, status, headers, ^ref} = :hackney.send_request(ref, request)
{:ok, content} = :hackney.body(ref)

Summary

Functions

Link to this function

accept(portnum, timeout)

View Source
@spec accept(DiodeClient.Acceptor.Listener.t(), any()) ::
  {:error, any()} | {:ok, pid()}

See :ssl.close/1.

Link to this function

connect(addr, port, opts \\ [], timeout \\ 5000)

View Source
@spec connect(binary(), integer(), keyword(), integer()) ::
  {:ok, pid()} | {:error, any()}
Link to this function

controlling_process(pid, dst)

View Source

See :ssl.controlling_process/2.

See :ssl.getopts/2.

Link to this function

handshake(pid, opts, timeout)

View Source
@spec listen(keyword()) :: DiodeClient.Acceptor.Listener.t()

See :ssl.peername/1.

See :ssl.recv/2.

Link to this function

recv(pid, length, timeout)

View Source

See :ssl.recv/3.

See :ssl.send/2.

Link to this function

sendfile(socket, path, offset, bytes)

View Source

See :ssl.setopts/2.

See :ssl.shutdown/2.