Module escalus_tcp

Module abstracting TCP connection to XMPP server.

Copyright © (C) 2011-2012, Erlang Solutions Ltd.

Behaviours: escalus_connection, gen_server.

Description

Module abstracting TCP connection to XMPP server

Data Types

opts()

opts() = #{host => binary() | inet:ip_address() | inet:hostname(), port => pos_integer(), ssl => boolean(), tls_module => ssl | fast_tls, stream_management => boolean(), manual_ack => boolean(), iface => inet:ip_address(), on_reply => function(), on_request => function(), on_connect => function(), event_client => undefined | escalus_event:event_client(), socket_opts => [gen_tcp:connect_option()], ssl_opts => [ssl:ssl_option()], parser_opts => [exml_stream:parser_opt()]}

sm_state()

sm_state() = {boolean(), non_neg_integer(), active | inactive}

state()

state() = #state{}

Function Index

assert_stream_end/2
assert_stream_start/2
code_change/3
connect/1
get_active/1
get_sm_h/1
get_tls_last_message/1
handle_call/3
handle_cast/2
handle_info/2
init/1
is_connected/1
is_using_compression/1
is_using_ssl/1
kill/1
reset_parser/1
send/2
set_active/2
set_filter_predicate/2
set_sm_h/2
stop/1
stream_end_req/1
stream_start_req/1
terminate/2
upgrade_to_tls/2
use_zlib/1

Function Details

assert_stream_end/2

assert_stream_end(Rep::exml_stream:element(), X2::term()) -> exml_stream:element()

assert_stream_start/2

assert_stream_start(Rep::exml_stream:element(), X2::term()) -> exml_stream:element()

code_change/3

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

connect/1

connect(Opts0::[proplists:property()] | opts()) -> pid()

get_active/1

get_active(Pid::pid()) -> boolean()

get_sm_h/1

get_sm_h(Pid::pid()) -> non_neg_integer()

get_tls_last_message/1

get_tls_last_message(Pid::pid()) -> {ok, binary()} | {error, undefined_tls_message}

handle_call/3

handle_call(X1::term(), From::{pid(), term()}, State::state()) -> {reply, term(), state()} | {stop, normal, ok, state()}

handle_cast/2

handle_cast(X1::{send, exml_stream:element() | [exml_stream:element()] | binary()}, State::state()) -> {noreply, state()} | {stop, term(), state()}

handle_info/2

handle_info(X1::term(), State::state()) -> {noreply, state()} | {stop, term(), state()}

init/1

init(X1::list()) -> {ok, state()}

is_connected/1

is_connected(Pid::pid()) -> boolean()

is_using_compression/1

is_using_compression(Pid::pid()) -> boolean()

is_using_ssl/1

is_using_ssl(Pid::pid()) -> boolean()

kill/1

kill(Pid::pid()) -> ok | already_stopped

reset_parser/1

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

send/2

send(Pid::pid(), ElemOrData::exml_stream:element() | [exml_stream:element()] | binary()) -> ok

set_active/2

set_active(Pid::pid(), Active::boolean() | once) -> ok

set_filter_predicate/2

set_filter_predicate(Pid::pid(), Pred::escalus_connection:filter_pred()) -> ok

set_sm_h/2

set_sm_h(Pid::pid(), H::non_neg_integer()) -> {ok, non_neg_integer()}

stop/1

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

stream_end_req/1

stream_end_req(X1::term()) -> exml_stream:element()

stream_start_req/1

stream_start_req(Props::escalus_users:user_spec()) -> exml_stream:element()

terminate/2

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

upgrade_to_tls/2

upgrade_to_tls(Pid::pid(), SSLOpts::[ssl:ssl_option()]) -> ok

use_zlib/1

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


Generated by EDoc