File: megaco_tcp.3

package info (click to toggle)
erlang-manpages 1%3A12.b.3-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,188 kB
  • ctags: 2
  • sloc: makefile: 68; perl: 30; sh: 15
file content (207 lines) | stat: -rw-r--r-- 3,717 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
.TH megaco_tcp 3 "megaco  3.8" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
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
.TP
Types
TransportRef = pid()
.br
.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
.TP
Types
TransportRef = pid() | regname()
.br
OptionListPerPort = [Option]
.br
Option = {port, integer()} |{options, list()} |{receive_handle, term()}
.br
.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
.TP
Types
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
.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
.TP
Types
Handle = socket_handle()
.br
.RE
.RS
.LP
This function is used for closing an active TPKT connection\&.
.RE
.LP
.B
socket(Handle) -> Socket
.br
.RS
.TP
Types
Handle = socket_handle()
.br
Socket = inet_socket()
.br
.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
.TP
Types
Handle = socket_handle()
.br
Message = binary() | iolist()
.br
.RE
.RS
.LP
Sends a message on a connection\&.
.RE
.LP
.B
block(Handle) -> ok
.br
.RS
.TP
Types
Handle = socket_handle()
.br
.RE
.RS
.LP
Stop receiving incomming messages on the socket\&.
.RE
.LP
.B
unblock(Handle) -> ok
.br
.RS
.TP
Types
Handle = socket_handle()
.br
.RE
.RS
.LP
Starting to receive incomming messages from the socket again\&.
.RE
.LP
.B
upgrade_receive_handle(ControlPid) -> ok
.br
.RS
.TP
Types
ControlPid = pid()
.br
.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
.TP
Types
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
.RS
.LP
Retreive the TCP related (SNMP) statistics counters\&.
.RE
.LP
.B
reset_stats() -> void()
.br
.B
reset_stats(SendHandle) -> void()
.br
.RS
.TP
Types
SendHandle = send_handle()
.br
.RE
.RS
.LP
Reset all TCP related (SNMP) statistics counters\&.
.RE