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()} | {re‐
30 ceive_handle, term()} | {inet_backend, default | inet |
31 socket}
32
33 This function is used for starting new TPKT listening socket for
34 TCP/IP. The option list contains the socket definitions.
35
36 inet_backend:
37 Choose the inet-backend.
38
39 This option make it possible to use a different inet-backend
40 ('default', 'inet' or 'socket').
41
42 Default is default (system default).
43
44 connect(TransportRef, OptionList) -> {ok, Handle, ControlPid} | {error,
45 Reason}
46
47 Types:
48
49 TransportRef = pid() | regname()
50 OptionList = [Option]
51 Option = {host, IpAddr} | {port, integer()} | {options,
52 list()} | {receive_handle, term()} | {module, atom()} |
53 {inet_backend, default | inet | socket}
54 Handle = socket_handle()
55 ControlPid = pid()
56 Reason = term()
57
58 This function is used to open a TPKT connection.
59
60 module:
61 This option makes it possible for the user to provide their
62 own callback module. The receive_message/4 or process_re‐
63 ceived_message/4 functions of this module is called when a
64 new message is received. Which one is called depends on the
65 size of the message;
66
67 small:
68 receive_message
69
70 large:
71 process_received_message
72
73 Default value is megaco.
74
75 inet_backend:
76 Choose the inet-backend.
77
78 This option make it possible to use a different inet-backend
79 ('default', 'inet' or 'socket').
80
81 Default is default (system default).
82
83 close(Handle) -> ok
84
85 Types:
86
87 Handle = socket_handle()
88
89 This function is used for closing an active TPKT connection.
90
91 socket(Handle) -> Socket
92
93 Types:
94
95 Handle = socket_handle()
96 Socket = inet_socket()
97
98 This function is used to convert a socket_handle() to a
99 inet_socket(). inet_socket() is a plain socket, see the inet
100 module for more info.
101
102 send_message(Handle, Message) -> ok
103
104 Types:
105
106 Handle = socket_handle()
107 Message = binary() | iolist()
108
109 Sends a message on a connection.
110
111 block(Handle) -> ok
112
113 Types:
114
115 Handle = socket_handle()
116
117 Stop receiving incoming messages on the socket.
118
119 unblock(Handle) -> ok
120
121 Types:
122
123 Handle = socket_handle()
124
125 Starting to receive incoming messages from the socket again.
126
127 upgrade_receive_handle(ControlPid) -> ok
128
129 Types:
130
131 ControlPid = pid()
132
133 Update the receive handle of the control process (e.g. after
134 having changed protocol version).
135
136 get_stats() -> {ok, TotalStats} | {error, Reason}
137 get_stats(SendHandle) -> {ok, SendHandleStats} | {error, Reason}
138 get_stats(SendHandle, Counter) -> {ok, CounterStats} | {error, Reason}
139
140 Types:
141
142 TotalStats = [send_handle_stats()]
143 total_stats() = {send_handle(), [stats()]}
144 SendHandle = send_handle()
145 SendHandleStats = [stats()]
146 Counter = tcp_stats_counter()
147 CounterStats = integer()
148 stats() = {tcp_stats_counter(), integer()}
149 tcp_stats_counter() = medGwyGatewayNumInMessages | medG‐
150 wyGatewayNumInOctets | medGwyGatewayNumOutMessages | medG‐
151 wyGatewayNumOutOctets | medGwyGatewayNumErrors
152 Reason = term()
153
154 Retreive the TCP related (SNMP) statistics counters.
155
156 reset_stats() -> void()
157 reset_stats(SendHandle) -> void()
158
159 Types:
160
161 SendHandle = send_handle()
162
163 Reset all TCP related (SNMP) statistics counters.
164
165
166
167Ericsson AB megaco 4.5 megaco_tcp(3)