quicer_remote_stream behaviour (quicer v0.4.3)

View Source

Stream initiated from remote

Summary

Types

active_n/0

-type active_n() :: boolean() | once | integer().

conf_handle/0

-type conf_handle() :: reference().

connection_handle/0

-type connection_handle() :: reference().

global_handle/0

-type global_handle() :: quic_global.

handle/0

listener_handle/0

-type listener_handle() :: reference().

reg_handle/0

-type reg_handle() :: reference().

remote_stream_opts/0

-type remote_stream_opts() :: stream_opts() | proplists:proplist().

stream_handle/0

-type stream_handle() :: reference().

stream_open_flags/0

-type stream_open_flags() :: 0 | 1 | 2.

stream_opts/0

-type stream_opts() ::
          #{active := active_n(),
            open_flag => stream_open_flags(),
            start_flag => stream_start_flags(),
            event_mask => uint32(),
            disable_fpbuffer => boolean(),
            stream_id => uint62(),
            priority => uint16(),
            ideal_send_buffer_size => uint64(),
            '0rtt_length' => uint64(),
            dynamic() => dynamic()}.

stream_start_flags/0

-type stream_start_flags() :: 0 | 1 | 2 | 4 | 8.

uint16/0

-type uint16() :: 0..1 bsl 16 - 1.

uint32/0

-type uint32() :: 0..1 bsl 32 - 1.

uint62/0

-type uint62() :: 0..1 bsl 62 - 1.

uint64/0

-type uint64() :: 0..1 bsl 64 - 1.

Callbacks

handle_call/3

(optional)
-callback handle_call(Req :: term(), gen_server:from(), cb_state()) -> cb_ret().
Handle API call with callback state.

handle_continue/2

(optional)
-callback handle_continue(Cont :: term(), cb_state()) -> cb_ret().
Handle continue from other callbacks with callback state.

handle_info/2

(optional)
-callback handle_info(Info :: term(), cb_state()) -> cb_ret().
Handle unhandled info with callback state.

handle_stream_data/4

(optional)
-callback handle_stream_data(stream_handle(), binary(), recv_data_props(), cb_state()) -> cb_ret().
Stream handle data

init_handoff/4

(optional)
-callback init_handoff(stream_handle(), stream_opts(), connection_handle(), new_stream_props()) -> cb_ret().
Prepare callback state before ownership handoff

new_stream/3

(optional)
-callback new_stream(stream_handle(), new_stream_props(), connection_handle()) -> cb_ret().
Stream accepter is assigned to the owner of the new stream

passive/3

-callback passive(stream_handle(), undefined, cb_state()) -> cb_ret().
Stream now in 'passive' mode.

peer_receive_aborted/3

-callback peer_receive_aborted(stream_handle(), error_code(), cb_state()) -> cb_ret().
Handle stream peer_receive_aborted

peer_send_aborted/3

-callback peer_send_aborted(stream_handle(), error_code(), cb_state()) -> cb_ret().
Handle stream peer_send_aborted.

peer_send_shutdown/3

-callback peer_send_shutdown(stream_handle(), undefined, cb_state()) -> cb_ret().
Handle stream peer_send_shutdown.

post_handoff/3

(optional)
-callback post_handoff(stream_handle(), PostInfo :: term(), cb_state()) -> cb_ret().
Post handoff with PostData if any. Most common action is to set the stream mode to active.

send_complete/3

(optional)
-callback send_complete(stream_handle(), IsCanceled :: boolean(), cb_state()) -> cb_ret().
Handle send completed.

send_shutdown_complete/3

-callback send_shutdown_complete(stream_handle(), IsGraceful :: boolean(), cb_state()) -> cb_ret().
Handle stream send_shutdown_complete. Happen immediately on an abortive send or after a graceful send has been acknowledged by the peer.

stream_closed/3

-callback stream_closed(stream_handle(), stream_closed_props(), cb_state()) -> cb_ret().
Handle stream closed, Both endpoints of sending and receiving of the stream have been shut down.

Functions

start(CallbackModule, Connection, Opts, StartOpts)

start(CallbackModule, Connection, Stream, Opts, Props, StartOpts)

start_link(CallbackModule, Connection, Opts)

start_link(CallbackModule, Connection, Opts, StartOpts)

start_link(CallbackModule, Connection, Stream, Opts, Props)

start_link(CallbackModule, Connection, Stream, Opts, Props, StartOpts)