1megaco_tcp(3) Erlang Module Definition megaco_tcp(3)
2
3
4
6 megaco_tcp - Interface module to TPKT transport protocol for
7 Megaco/H.248.
8
10 This module contains the public interface to the TPKT (TCP/IP) version
11 transport protocol for Megaco/H.248.
12
14 start_transport() -> {ok, TransportRef}
15
16 Types:
17
18 TransportRef = pid()
19
20 This function is used for starting the TCP/IP transport service.
21 Use exit(TransportRef, Reason) to stop the transport service.
22
23 listen(TransportRef, ListenPortSpecList) -> ok
24
25 Types:
26
27 TransportRef = pid() | regname()
28 OptionListPerPort = [Option]
29 Option = {port, integer()} |{options, list()} |{receive_han‐
30 dle, term()}
31
32 This function is used for starting new TPKT listening socket for
33 TCP/IP. The option list contains the socket definitions.
34
35 connect(TransportRef, OptionList) -> {ok, Handle, ControlPid} | {error,
36 Reason}
37
38 Types:
39
40 TransportRef = pid() | regname()
41 OptionList = [Option]
42 Option = {host, Ipaddr} | {port, integer()} |{options,
43 list()} |{receive_handle, term()} |{module, atom()}
44 Handle = socket_handle()
45 ControlPid = pid()
46 Reason = term()
47
48 This function is used to open a TPKT connection.
49
50 The module option makes it possible for the user to provide
51 their own callback module. The receive_message/4 or
52 process_received_message/4 functions of this module is called
53 when a new message is received (which one depends on the size of
54 the message; small - receive_message, large -
55 process_received_message). Default value is megaco.
56
57 close(Handle) -> ok
58
59 Types:
60
61 Handle = socket_handle()
62
63 This function is used for closing an active TPKT connection.
64
65 socket(Handle) -> Socket
66
67 Types:
68
69 Handle = socket_handle()
70 Socket = inet_socket()
71
72 This function is used to convert a socket_handle() to a
73 inet_socket(). inet_socket() is a plain socket, see the inet
74 module for more info.
75
76 send_message(Handle, Message) -> ok
77
78 Types:
79
80 Handle = socket_handle()
81 Message = binary() | iolist()
82
83 Sends a message on a connection.
84
85 block(Handle) -> ok
86
87 Types:
88
89 Handle = socket_handle()
90
91 Stop receiving incoming messages on the socket.
92
93 unblock(Handle) -> ok
94
95 Types:
96
97 Handle = socket_handle()
98
99 Starting to receive incoming messages from the socket again.
100
101 upgrade_receive_handle(ControlPid) -> ok
102
103 Types:
104
105 ControlPid = pid()
106
107 Update the receive handle of the control process (e.g. after
108 having changed protocol version).
109
110 get_stats() -> {ok, TotalStats} | {error, Reason}
111 get_stats(SendHandle) -> {ok, SendHandleStats} | {error, Reason}
112 get_stats(SendHandle, Counter) -> {ok, CounterStats} | {error, Reason}
113
114 Types:
115
116 TotalStats = [send_handle_stats()]
117 total_stats() = {send_handle(), [stats()]}
118 SendHandle = send_handle()
119 SendHandleStats = [stats()]
120 Counter = tcp_stats_counter()
121 CounterStats = integer()
122 stats() = {tcp_stats_counter(), integer()}
123 tcp_stats_counter() = medGwyGatewayNumInMessages | medG‐
124 wyGatewayNumInOctets | medGwyGatewayNumOutMessages | medG‐
125 wyGatewayNumOutOctets | medGwyGatewayNumErrors
126 Reason = term()
127
128 Retreive the TCP related (SNMP) statistics counters.
129
130 reset_stats() -> void()
131 reset_stats(SendHandle) -> void()
132
133 Types:
134
135 SendHandle = send_handle()
136
137 Reset all TCP related (SNMP) statistics counters.
138
139
140
141Ericsson AB megaco 3.18.6 megaco_tcp(3)