Module xmpp_stream_in

Behaviours: ?GEN_SERVER.

This module defines the xmpp_stream_in behaviour.
Optional callback functions: init/1, handle_cast/2, handle_call/3, handle_info/2, terminate/2, code_change/3, handle_stream_start/2, handle_stream_established/1, handle_stream_end/2, handle_cdata/2, handle_authenticated_packet/2, handle_unauthenticated_packet/2, handle_unbinded_packet/2, handle_auth_success/4, handle_auth_failure/4, handle_send/3, handle_recv/3, handle_timeout/1, get_password_fun/1, get_password_fun/2, check_password_fun/2, check_password_digest_fun/2, bind/2, compress_methods/1, tls_options/1, tls_required/1, tls_enabled/1, sasl_mechanisms/2, unauthenticated_stream_features/1, authenticated_stream_features/1.

Data Types

next_state()

next_state() = noreply() | {stop, term(), state()}

noreply()

noreply() = {noreply, state(), timeout()}

state()

state() = #{owner := pid(), mod := module(), socket := xmpp_socket:socket(), socket_mod => xmpp_socket:sockmod(), socket_opts => [proplists:property()], socket_monitor => reference(), stream_timeout := {integer(), integer()} | infinity, stream_state := stream_state(), stream_direction => in | out, stream_id => binary(), stream_header_sent => boolean(), stream_restarted => boolean(), stream_compressed => boolean(), stream_encrypted => boolean(), stream_version => {non_neg_integer(), non_neg_integer()}, stream_authenticated => boolean(), ip => {inet:ip_address(), inet:port_number()}, codec_options => [xmpp:decode_option()], xmlns => binary(), lang => binary(), user => binary(), server => binary(), resource => binary(), lserver => binary(), remote_server => binary(), sasl_mech => binary(), sasl_state => xmpp_sasl:sasl_state(), term() => term()}

stop_reason()

stop_reason() = {stream, reset | {in | out, stream_error()}} | {tls, inet:posix() | atom() | binary()} | {socket, inet:posix() | atom()} | internal_failure

stream_state()

stream_state() = accepting | wait_for_stream | wait_for_handshake | wait_for_starttls | wait_for_sasl_request | wait_for_sasl_response | wait_for_bind | established | disconnected

Function Index

accept/1
call/3
cast/2
change_shaper/2
close/1
close/2
code_change/3
establish/1
format_error/1
get_transport/1
handle_call/3
handle_cast/2
handle_info/2
init/1
reply/2
send/2
send_error/3
send_ws_ping/1
set_timeout/2
start/3
start_link/3
stop/1
terminate/2

Function Details

accept/1

accept(Pid::pid()) -> ok

call/3

call(Ref, Msg, Timeout) -> any()

cast/2

cast(Ref, Msg) -> any()

change_shaper/2

change_shaper(State::state(), Shaper::none | p1_shaper:state()) -> state()

close/1

close(Pid::pid()) -> ok

close(Pid::state()) -> state()

close/2

close(Pid::pid(), Reason::atom()) -> ok

code_change/3

code_change(OldVsn::term(), State::state(), Extra::term()) -> {ok, state()} | {error, term()}

establish/1

establish(State::state()) -> state()

format_error/1

format_error(Err::stop_reason()) -> binary()

get_transport/1

get_transport(X1::state()) -> atom()

handle_call/3

handle_call(Call::term(), From::term(), State::state()) -> next_state()

handle_cast/2

handle_cast(Cast::term(), State::state()) -> next_state()

handle_info/2

handle_info(Info::term(), State::state()) -> next_state()

init/1

init(X1) -> any()

reply/2

reply(Ref, Reply) -> any()

send/2

send(Pid::pid(), Pkt::xmpp_element()) -> ok

send(Pid::state(), Pkt::xmpp_element()) -> state()

send_error/3

send_error(State::state(), Pkt::xmpp_element() | xmlel(), Err::stanza_error()) -> state()

send_ws_ping/1

send_ws_ping(Pid::pid()) -> ok

send_ws_ping(Pid::state()) -> state()

set_timeout/2

set_timeout(State::state(), Timeout::non_neg_integer() | infinity) -> state()

start/3

start(Mod, Args, Opts) -> any()

start_link/3

start_link(Mod, Args, Opts) -> any()

stop/1

stop(Pid::pid()) -> ok

stop(Pid::state()) -> no_return()

terminate/2

terminate(Reason::term(), State::state()) -> state()


Generated by EDoc