ranch:handshake_cancel(3)

Name

ranch:handshake_cancel - Cancel the paused transport handshake

Description

handshake_cancel(Ref :: ranch:ref()) -> ok

Cancel the paused transport handshake.

This function may be called by the protocol process to cancel a paused handshake.

Arguments

Ref

The listener name.

Allowed options depend on the transport module.

Return value

The return value depends on the transport module.

Changelog

  • 2.0: Function introduced.

Examples

Cancel a paused transport handshake
start_link(Ref, Transport, Opts) ->
    Pid = proc_lib:spawn_link(?MODULE, init,
        [Ref, Transport, Opts]),
    {ok, Pid}.

init(Ref, Transport, Opts) ->
    {continue, _Info} = ranch:handshake(Ref),
    ranch:handshake_cancel(Ref),
    exit(handshake_cancelled).

See also

ranch:handshake(3), ranch:handshake_continue(3), ranch(3)

Ranch 2.0 Function Reference

Navigation

Version select

Like my work? Donate!

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

Recurring payment options are also available via BountySource. These funds are used to cover the recurring expenses like dedicated servers or domain names.