.TH megaco_tcp 3erl "megaco 3.19.5" "Ericsson AB" "Erlang Module Definition" .SH NAME megaco_tcp \- Interface module to TPKT transport protocol for Megaco/H.248. .SH DESCRIPTION .LP This module contains the public interface to the TPKT (TCP/IP) version transport protocol for Megaco/H\&.248\&. .SH EXPORTS .LP .B start_transport() -> {ok, TransportRef} .br .RS .LP Types: .RS 3 TransportRef = pid() .br .RE .RE .RS .LP This function is used for starting the TCP/IP transport service\&. Use exit(TransportRef, Reason) to stop the transport service\&. .RE .LP .B listen(TransportRef, ListenPortSpecList) -> ok .br .RS .LP Types: .RS 3 TransportRef = pid() | regname() .br OptionListPerPort = [Option] .br Option = {port, integer()} |{options, list()} |{receive_handle, term()} .br .RE .RE .RS .LP This function is used for starting new TPKT listening socket for TCP/IP\&. The option list contains the socket definitions\&. .RE .LP .B connect(TransportRef, OptionList) -> {ok, Handle, ControlPid} | {error, Reason} .br .RS .LP Types: .RS 3 TransportRef = pid() | regname() .br OptionList = [Option] .br Option = {host, Ipaddr} | {port, integer()} |{options, list()} |{receive_handle, term()} |{module, atom()} .br Handle = socket_handle() .br ControlPid = pid() .br Reason = term() .br .RE .RE .RS .LP This function is used to open a TPKT connection\&. .LP The \fImodule\fR\& option makes it possible for the user to provide their own callback module\&. The \fIreceive_message/4\fR\& or \fIprocess_received_message/4\fR\& functions of this module is called when a new message is received (which one depends on the size of the message; small - receive_message, large - process_received_message)\&. Default value is \fImegaco\fR\&\&. .RE .LP .B close(Handle) -> ok .br .RS .LP Types: .RS 3 Handle = socket_handle() .br .RE .RE .RS .LP This function is used for closing an active TPKT connection\&. .RE .LP .B socket(Handle) -> Socket .br .RS .LP Types: .RS 3 Handle = socket_handle() .br Socket = inet_socket() .br .RE .RE .RS .LP This function is used to convert a socket_handle() to a inet_socket()\&. inet_socket() is a plain socket, see the inet module for more info\&. .RE .LP .B send_message(Handle, Message) -> ok .br .RS .LP Types: .RS 3 Handle = socket_handle() .br Message = binary() | iolist() .br .RE .RE .RS .LP Sends a message on a connection\&. .RE .LP .B block(Handle) -> ok .br .RS .LP Types: .RS 3 Handle = socket_handle() .br .RE .RE .RS .LP Stop receiving incoming messages on the socket\&. .RE .LP .B unblock(Handle) -> ok .br .RS .LP Types: .RS 3 Handle = socket_handle() .br .RE .RE .RS .LP Starting to receive incoming messages from the socket again\&. .RE .LP .B upgrade_receive_handle(ControlPid) -> ok .br .RS .LP Types: .RS 3 ControlPid = pid() .br .RE .RE .RS .LP Update the receive handle of the control process (e\&.g\&. after having changed protocol version)\&. .RE .LP .B get_stats() -> {ok, TotalStats} | {error, Reason} .br .B get_stats(SendHandle) -> {ok, SendHandleStats} | {error, Reason} .br .B get_stats(SendHandle, Counter) -> {ok, CounterStats} | {error, Reason} .br .RS .LP Types: .RS 3 TotalStats = [send_handle_stats()] .br total_stats() = {send_handle(), [stats()]} .br SendHandle = send_handle() .br SendHandleStats = [stats()] .br Counter = tcp_stats_counter() .br CounterStats = integer() .br stats() = {tcp_stats_counter(), integer()} .br tcp_stats_counter() = medGwyGatewayNumInMessages | medGwyGatewayNumInOctets | medGwyGatewayNumOutMessages | medGwyGatewayNumOutOctets | medGwyGatewayNumErrors .br Reason = term() .br .RE .RE .RS .LP Retreive the TCP related (SNMP) statistics counters\&. .RE .LP .B reset_stats() -> void() .br .B reset_stats(SendHandle) -> void() .br .RS .LP Types: .RS 3 SendHandle = send_handle() .br .RE .RE .RS .LP Reset all TCP related (SNMP) statistics counters\&. .RE