megaco_tcp(3erl)
π megaco_tcp(3erl) β TPKT transport, bestie edition π
okay so this is the page for megaco_tcp(3erl), and itβs giving public interface to the TPKT transport protocol for Megaco/H.248. no cap. π
πΈ NAME πΈ
megaco_tcp β interface module to TPKT transport protocol for Megaco/H.248. literally the public-facing bestie of this transport. π«Ά
π¦ DESCRIPTION π¦
This module contains the public interface to the TPKT (TCP/IP) version transport protocol for Megaco/H.248. thatβs the whole assignment. β¨
π EXPORTS π
π start_transport() -> {ok, TransportRef} π
Types:
TransportRef = pid()
This function is used for starting the TCP/IP transport service. to stop the transport service, use exit(TransportRef, Reason). periodt. π
π listen(TransportRef, ListenPortSpecList) -> ok π
Types:
TransportRef = pid() | regname()
OptionListPerPort = [Option]
The Option type is exactly one of these shapes, no cap:
{port, integer()}{options, list()}{receive_handle, term()}{inet_backend, default | inet | socket}
This function is used for starting new TPKT listening socket for TCP/IP. The option list contains the socket definitions. slay. π
π¦ connect(TransportRef, OptionList) -> {ok, Handle, ControlPid} | {error, Reason} π¦
Types:
TransportRef = pid() | regname()
OptionList = [Option]
Handle = socket_handle()
ControlPid = pid()
Reason = term()
The Option type is exactly one of these shapes:
{host, IpAddr}{port, integer()}{options, list()}{receive_handle, term()}{module, atom()}{inet_backend, default | inet | socket}
This function is used to open a TPKT connection. π«Ά
π§ module π§
This option makes it possible for the user to provide their own callback module. The receive_message/4 or process_received_message/4 function of this module is called when a new message is received. Which one gets called depends on the size of the message;
- small:
receive_message - large:
process_received_message
Default value is megaco. π
π close(Handle) -> ok π
Types:
Handle = socket_handle()
This function is used for closing an active TPKT connection. bye bestie π
πΈ socket(Handle) -> Socket πΈ
Types:
Handle = socket_handle()
Socket = inet_socket()
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. iconic. β¨
π send_message(Handle, Message) -> ok π
Types:
Handle = socket_handle()
Message = binary() | iolist()
Sends a message on a connection. π
π block(Handle) -> ok π
Types:
Handle = socket_handle()
Stop receiving incoming messages on the socket. not me hitting pause π
βΆοΈ unblock(Handle) -> ok βΆοΈ
Types:
Handle = socket_handle()
Starting to receive incoming messages from the socket again. weβre so back π¦
π§ upgrade_receive_handle(ControlPid) -> ok π§
Types:
ControlPid = pid()
Update the receive handle of the control process (e.g. after having changed protocol version). glow-up moment π«
π get_stats() / get_stats(SendHandle) / get_stats(SendHandle, Counter) π
get_stats() -> {ok, TotalStats} | {error, Reason}
get_stats(SendHandle) -> {ok, SendHandleStats} | {error, Reason}
get_stats(SendHandle, Counter) -> {ok, CounterStats} | {error, Reason}
Types:
TotalStats = [send_handle_stats()]
total_stats() = {send_handle(), [stats()]}
SendHandle = send_handle()
SendHandleStats = [stats()]
Counter = tcp_stats_counter()
CounterStats = integer()
stats() = {tcp_stats_counter(), integer()}
tcp_stats_counter() = medGwyGatewayNumInMessages |
medGwyGatewayNumInOctets | medGwyGatewayNumOutMessages |
medGwyGatewayNumOutOctets | medGwyGatewayNumErrors
Reason = term()
Retreive the TCP related (SNMP) statistics counters. numbers bestie π₯
π§Ή reset_stats() -> void() / reset_stats(SendHandle) -> void() π§Ή
reset_stats() -> void()
reset_stats(SendHandle) -> void()
Types:
SendHandle = send_handle()
Reset all TCP related (SNMP) statistics counters. clean slate energy π
Signed off by Ericsson AB π β version megaco 4.4.3 β manual bestie megaco_tcp(3erl). mwah π
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms