~ubuntu-branches/ubuntu/wily/afnix/wily

« back to all changes in this revision

Viewing changes to src/mod/net/doc/appendix-ii.xml

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2011-03-16 21:31:18 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110316213118-gk4k3ez3e5d2huna
Tags: 2.0.0-1
* QA upload.
* New upstream release
* Debian source format is 3.0 (quilt)
* Fix debhelper-but-no-misc-depends
* Fix ancient-standards-version
* Fix package-contains-linda-override
* debhelper compatibility is 7
* Fix dh-clean-k-is-deprecated

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
<!-- = incidental  or special  damages arising  in any way out of the use = -->
14
14
<!-- = of this software.                                                  = -->
15
15
<!-- ====================================================================== -->
16
 
<!-- = copyright (c) 1999-2007 - amaury darsch                            = -->
 
16
<!-- = copyright (c) 1999-2011 - amaury darsch                            = -->
17
17
<!-- ====================================================================== -->
18
18
 
19
19
<appendix module="net" number="ii">
20
 
  <title>Mail services reference</title>
21
 
 
22
 
  <!-- =================================================================== -->
23
 
  <!-- = mail object                                                     = -->
24
 
  <!-- =================================================================== -->
25
 
 
26
 
  <object nameset="afnix:net">
27
 
    <name>Mail</name>
28
 
 
29
 
    <!-- synopsis -->
30
 
    <p>
31
 
    The <code>Mail</code> class is a mail delivery object which
32
 
    manages to contact a <em>Mail Transport Agent</em> or MTA in order
33
 
    to deliver a message to one or several recipients. By default, the
34
 
    object contacts the local MTA, but this behavior can be changed
35
 
    with the <code>set-mta-address</code> method. The class implements
36
 
    the recipient an address syntax scheme as specified by RFC822. At
37
 
    construction, the instance is empty. Only the recipient address
38
 
    needs to be specified. The <code>send</code> method send the
39
 
    message by contacting the MTA. If an error occurs, an exception is
40
 
    raised.
41
 
    </p>
42
 
 
43
 
    <!-- predicate -->
44
 
    <pred>mail-p</pred>
45
 
 
46
 
    <!-- inheritance -->
47
 
    <inherit>
48
 
      <name>Object</name>
49
 
    </inherit>
50
 
 
51
 
    <!-- constructor -->
52
 
    <ctors>
53
 
     <ctor>
54
 
      <name>Mail</name>
55
 
      <args>none</args>
56
 
      <p>
57
 
      The <code>Mail</code> constructor create a a default message
58
 
      which is empty. The recipient addresses and the subject must be
59
 
      specified for a successful message delivery.
60
 
      </p>
61
 
     </ctor>
62
 
    </ctors>
63
 
 
64
 
    <!-- methods -->
65
 
    <methods>
66
 
     <meth>
67
 
      <name>to</name>
68
 
      <retn>none</retn>
69
 
      <args>String</args>
70
 
      <p>
71
 
      The <code>to</code> method adds one or several address to the
72
 
      <em>destination list</em>. The address format must conform to
73
 
      RFC822. Multiple address are coma separated. Multiple call to this
74
 
      method is possible.
75
 
      </p>
76
 
     </meth>
77
 
 
78
 
     <meth>
79
 
      <name>cc</name>
80
 
      <retn>none</retn>
81
 
      <args>String</args>
82
 
      <p>
83
 
      The <code>cc</code> method adds one or several address to the
84
 
      <em>copy list</em>. The address format must conform to
85
 
      RFC822. Multiple address are coma separated. Multiple call to
86
 
      this method is possible.
87
 
      </p>
88
 
     </meth>
89
 
 
90
 
     <meth>
91
 
      <name>bcc</name>
92
 
      <retn>none</retn>
93
 
      <args>String</args>
94
 
      <p>
95
 
      The <code>bcc</code> method adds one or several address to the
96
 
      <em>blind copy list</em>. The address format must conform to
97
 
      RFC822. Multiple address are coma separated. Multiple call to this
98
 
      method is possible. The <em>blind copy list</em> is not included in
99
 
      the message header.
100
 
      </p>
101
 
     </meth>
102
 
 
103
 
     <meth>
104
 
      <name>add</name>
105
 
      <retn>none</retn>
106
 
      <args>String ...</args>
107
 
      <p>
108
 
      The <code>add</code> method adds one or several literals to the
109
 
      message buffer. This is the normal way to fill a message buffer
110
 
      by string line.
111
 
      </p>
112
 
     </meth>
113
 
 
114
 
     <meth>
115
 
      <name>addln</name>
116
 
      <retn>none</retn>
117
 
      <args>String ...</args>
118
 
      <p>
119
 
      The <code>addln</code> method adds one or several literals to
120
 
      the message buffer. A newline character is added at the end of
121
 
      the line. This is a similar way to fill a message buffer by
122
 
      string line.
123
 
      </p>
124
 
     </meth>
125
 
 
126
 
     <meth>
127
 
      <name>send</name>
128
 
      <retn>none</retn>
129
 
      <args>none</args>
130
 
      <p>
131
 
      The <code>send</code> method request a message delivery by
132
 
      contacting the MTA. Once the MTA has been contacted, the message
133
 
      header and the message body is transferred. The MTA is
134
 
      responsible to deliver the message to the appropriate
135
 
      recipients.
136
 
      </p>
137
 
     </meth>
138
 
 
139
 
     <meth>
140
 
      <name>subject</name>
141
 
      <retn>none</retn>
142
 
      <args>String</args>
143
 
      <p>
144
 
      The <code>subject</code> method sets the message subject string
145
 
      line.
146
 
      </p>
147
 
     </meth>
148
 
 
149
 
     <meth>
150
 
      <name>set-mta-address</name>
151
 
      <retn>none</retn>
152
 
      <args>String</args>
153
 
      <p>
154
 
      The <code>set-mta-address</code> method sets the MTA IP address
155
 
      that the class needs to contact for mail request. The address
156
 
      can be an fully qualified host name or an IP number.
157
 
      </p>
158
 
     </meth>
159
 
 
160
 
     <meth>
161
 
      <name>get-mta-address</name>
162
 
      <retn>String</retn>
163
 
      <args>none</args>
164
 
      <p>
165
 
      The <code>get-mta-address</code> method returns the current MTA
166
 
      IP address for this mail object.
167
 
      </p>
168
 
     </meth>
169
 
 
170
 
     <meth>
171
 
      <name>set-mta-port</name>
172
 
      <retn>none</retn>
173
 
      <args>Integer</args>
174
 
      <p>
175
 
      The <code>set-mta-port</code> method set the current MTA IP port
176
 
      number for this mail object. With the MTA IP address, the MTA to
177
 
      contact for mail request is uniquely defined. The default port
178
 
      value is 25.
179
 
      </p>
180
 
     </meth>
181
 
 
182
 
     <meth>
183
 
      <name>get-mta-port</name>
184
 
      <retn>Integer</retn>
185
 
      <args>none</args>
186
 
      <p>
187
 
      The <code>get-mta-port</code> method returns the current MTA IP
188
 
      port number for this mail object. The default port value is 25.
189
 
      </p>
190
 
     </meth>
191
 
    </methods>
 
20
  <title>Network sockets reference</title>
 
21
 
 
22
  <!-- =================================================================== -->
 
23
  <!-- = socket object                                                   = -->
 
24
  <!-- =================================================================== -->
 
25
  
 
26
  <object nameset="afnix:net">
 
27
    <name>Socket</name>
 
28
 
 
29
    <!-- synopsis -->
 
30
    <p> 
 
31
      The <code>Socket</code> class is a base class for the <afnix/>
 
32
      network services. The class is automatically constructed by a
 
33
      derived class and provide some common methods for all socket
 
34
      objects.
 
35
    </p>
 
36
 
 
37
    <!-- predicate -->
 
38
    <pred>socket-p</pred>
 
39
 
 
40
    <!-- inheritance -->
 
41
    <inherit>
 
42
      <name>InputStream</name>
 
43
      <name>OutputStream</name>
 
44
    </inherit>
 
45
 
 
46
    <!-- constants -->
 
47
    <constants>
 
48
      <const>
 
49
        <name>REUSE-ADDRESS</name>
 
50
        <p>
 
51
          The <code>REUSE-ADDRESS</code> constant is used by the
 
52
          <code>set-option</code> method to enable socket address
 
53
          reuse. This option changes the rules that validates the address
 
54
          used by bind. It is not recommended to use that option as it
 
55
          decreases TCP reliability.
 
56
        </p>
 
57
      </const>
 
58
 
 
59
      <const>
 
60
        <name>BROADCAST</name>
 
61
        <p>
 
62
          The <code>BROADCAST</code> constant is used by the
 
63
          <code>set-option</code> method to enable broadcast of
 
64
          packets. This options only works with IP version 4 address. The
 
65
          argument is a boolean flag only. 
 
66
        </p>
 
67
      </const>
 
68
 
 
69
      <const>
 
70
        <name>DONT-ROUTE</name>
 
71
        <p>
 
72
          The <code>DONT-ROUTE</code> constant is used by the
 
73
          <code>set-option</code> method to control if a packet is to be
 
74
          sent via the routing table. This option is rarely used with
 
75
          <afnix/>. The argument is a boolean flag only. 
 
76
        </p>
 
77
      </const>
 
78
 
 
79
      <const>
 
80
        <name>KEEP-ALIVE</name>
 
81
        <p>
 
82
          The <code>KEEP-ALIVE</code> constant is used by the
 
83
          <code>set-option</code> method to check periodically if the
 
84
          connection is still alive. This option is rarely used with
 
85
          <afnix/>. The argument is a boolean flag only. 
 
86
        </p>
 
87
      </const>
 
88
 
 
89
      <const>
 
90
        <name>LINGER</name>
 
91
        <p>
 
92
          The <code>LINGER</code> constant is used by the
 
93
          <code>set-option</code> method to turn on or off the lingering
 
94
          on close. If the first argument is true, the second argument is
 
95
          the linger time.
 
96
        </p>
 
97
      </const>
 
98
 
 
99
      <const>
 
100
        <name>RCV-SIZE</name>
 
101
        <p>
 
102
          The <code>RCV-SIZE</code> constant is used by the
 
103
          <code>set-option</code> method to set the receive buffer size. 
 
104
        </p>
 
105
      </const>
 
106
 
 
107
      <const>
 
108
        <name>SND-SIZE</name>
 
109
        <p>
 
110
          The <code>SND-SIZE</code> constant is used by the
 
111
          <code>set-option</code> method to set the send buffer size.
 
112
        </p>
 
113
      </const>
 
114
 
 
115
      <const>
 
116
        <name>HOP-LIMIT</name>
 
117
        <p>
 
118
          The <code>HOP-LIMIT</code> constant is used by the
 
119
          <code>set-option</code> method to set packet hop limit.
 
120
        </p>
 
121
      </const>
 
122
 
 
123
      <const>
 
124
        <name>MULTICAST-LOOPBACK</name>
 
125
        <p>
 
126
          The <code>MULTICAST-LOOPBACK</code> constant is used by the
 
127
          <code>set-option</code> method to control whether or not
 
128
          multicast packets are copied to the loopback. The argument is a
 
129
          boolean flag only.
 
130
        </p>
 
131
      </const>
 
132
 
 
133
      <const>
 
134
        <name>MULTICAST-HOP-LIMIT</name>
 
135
        <p>
 
136
          The <code>MULTICAST-HOP-LIMIT</code> constant is used by the
 
137
          <code>set-option</code> method to set the hop limit for
 
138
          multicast packets.
 
139
        </p>
 
140
      </const>
 
141
 
 
142
      <const>
 
143
        <name>MAX-SEGMENT-SIZE</name>
 
144
        <p>
 
145
          The <code>MAX-SEGMENT-SIZE</code> constant is used by the
 
146
          <code>set-option</code> method to set the TCP maximum segment size.
 
147
        </p>
 
148
      </const>
 
149
 
 
150
      <const>
 
151
        <name>NO-DELAY</name>
 
152
        <p>
 
153
          The <code>NO-DELAY</code> constant is used by the
 
154
          <code>set-option</code> method to enable or disable the Naggle
 
155
          algorithm.
 
156
        </p>
 
157
      </const>
 
158
    </constants>
 
159
 
 
160
    <!-- methods -->
 
161
    <methods>
 
162
      <meth>
 
163
        <name>bind</name>
 
164
        <retn>none</retn>
 
165
        <args>Integer</args>
 
166
        <p>
 
167
          The <code>bind</code> method binds this socket to the port
 
168
          specified as the argument.
 
169
        </p>
 
170
      </meth>
 
171
 
 
172
      <meth>
 
173
        <name>bind</name>
 
174
        <retn>none</retn>
 
175
        <args>Integer Address</args>
 
176
        <p>
 
177
          The <code>bind</code> method binds this socket to the port
 
178
          specified as the first argument and the address specified as the
 
179
          second argument.
 
180
        </p>
 
181
      </meth>
 
182
 
 
183
      <meth>
 
184
        <name>connect</name>
 
185
        <retn>none</retn>
 
186
        <args>Integer Address [Boolean]</args>
 
187
        <p>
 
188
          The <code>connect</code> method connects this socket to the port
 
189
          specified as the first argument and the address specified as the
 
190
          second argument. A connected socket is useful with udp client
 
191
          that talks only with one fixed server. The optional third
 
192
          argument is a boolean flag that permits to select whether or not
 
193
          the alias addressing scheme should be used. If the flag is false,
 
194
          the default address is used. If the flag is true, an attempt is
 
195
          made to connect to the first successful address that is part
 
196
          of the alias list.
 
197
        </p>
 
198
      </meth>
 
199
 
 
200
      <meth>
 
201
        <name>open-p</name>
 
202
        <retn>Boolean</retn>
 
203
        <args>none</args>
 
204
        <p>
 
205
          The <code>open-p</code> predicate returns true if the socket is
 
206
          open. The method checks that a descriptor is attached to the
 
207
          object. This does not mean that the descriptor is valid in the
 
208
          sense that one can read or write on it. This method is useful to
 
209
          check if a socket has not been closed.
 
210
        </p>
 
211
      </meth>
 
212
 
 
213
      <meth>
 
214
        <name>shutdown</name>
 
215
        <retn>Boolean</retn>
 
216
        <args>none|Boolean</args>
 
217
        <p>
 
218
          The <code>shutdown</code> method shutdowns or close the
 
219
          connection. Without argument, the connection is closed without
 
220
          consideration for those symbols attached to the object. With one
 
221
          argument, the connection is closed in one direction only. If the
 
222
          mode argument is false, further receive is disallowed. If the
 
223
          mode argument is true, further send is disallowed. The method
 
224
          returns true on success, false otherwise.
 
225
        </p>
 
226
      </meth>
 
227
 
 
228
      <meth>
 
229
        <name>ipv6-p</name>
 
230
        <retn>Boolean</retn>
 
231
        <args>none</args>
 
232
        <p>
 
233
          The <code>ipv6-p</code> predicate returns true if the socket
 
234
          address is an IP version 6 address, false otherwise.
 
235
        </p>
 
236
      </meth>
 
237
 
 
238
      <meth>
 
239
        <name>get-socket-address</name>
 
240
        <retn>Address</retn>
 
241
        <args>none</args>
 
242
        <p>
 
243
          The <code>get-socket-address</code> method returns an address
 
244
          object of the socket. The returned object can be later used to
 
245
          query the canonical name and the ip address.
 
246
        </p>
 
247
      </meth>
 
248
 
 
249
      <meth>
 
250
        <name>get-socket-port</name>
 
251
        <retn>Integer</retn>
 
252
        <args>none</args>
 
253
        <p>
 
254
          The <code>get-socket-port</code> method returns the port
 
255
          number of the socket.
 
256
        </p>
 
257
      </meth>
 
258
 
 
259
      <meth>
 
260
        <name>get-socket-authority</name>
 
261
        <retn>String</retn>
 
262
        <args>none</args>
 
263
        <p>
 
264
          The <code>get-socket-authority</code> method returns the authority
 
265
          string in the form of an address and port pair of the socket.
 
266
        </p>
 
267
      </meth>
 
268
 
 
269
      <meth>
 
270
        <name>get-peer-address</name>
 
271
        <retn>Address</retn>
 
272
        <args>none</args>
 
273
        <p>
 
274
          The <code>get-peer-address</code> method returns an address
 
275
          object of the socket's peer. The returned object can be later
 
276
          used to query the canonical name and the ip address.
 
277
        </p>
 
278
      </meth>
 
279
 
 
280
      <meth>
 
281
        <name>get-peer-port</name>
 
282
        <retn>Integer</retn>
 
283
        <args>none</args>
 
284
        <p>
 
285
          The <code>get-peer-port</code> method returns the port
 
286
          number of the socket's peer.
 
287
        </p>
 
288
      </meth>
 
289
 
 
290
      <meth>
 
291
        <name>get-peer-authority</name>
 
292
        <retn>String</retn>
 
293
        <args>none</args>
 
294
        <p>
 
295
          The <code>get-peer-authority</code> method returns the authority
 
296
          string in the form of an address and port pair of the socket's peer.
 
297
        </p>
 
298
      </meth>
 
299
 
 
300
      <meth>
 
301
        <name>set-option</name>
 
302
        <retn>Boolean</retn>
 
303
        <args>constant [Boolean|Integer] [Integer]</args>
 
304
        <p>
 
305
          The <code>set-option</code> method set a socket option. The
 
306
          first argument is the option to set. The second argument is a
 
307
          boolean value which turn on or off the option. The optional
 
308
          third argument is an integer needed for some options.
 
309
        </p>
 
310
      </meth>
 
311
 
 
312
      <meth>
 
313
        <name>set-encoding-mode</name>
 
314
        <retn>none</retn>
 
315
        <args>Item|String</args>
 
316
        <p>
 
317
          The <code>set-encoding-mode</code> method sets the input and
 
318
          output encoding mode. In the first form, with an item, the
 
319
          stream encoding mode is set directly. In the second form, the
 
320
          encoding mode is set with a string and might also alter the
 
321
          stream transcoing mode.
 
322
        </p>
 
323
      </meth>
 
324
 
 
325
      <meth>
 
326
        <name>set-input-encoding-mode</name>
 
327
        <retn>none</retn>
 
328
        <args>Item|String</args>
 
329
        <p>
 
330
          The <code>set-input-encoding-mode</code> method sets the input
 
331
          encoding mode. In the first form, with an item, the
 
332
          stream encoding mode is set directly. In the second form, the
 
333
          encoding mode is set with a string and might also alter the
 
334
          stream transcoing mode.
 
335
        </p>
 
336
      </meth>
 
337
 
 
338
      <meth>
 
339
        <name>get-input-encoding-mode</name>
 
340
        <retn>Item</retn>
 
341
        <args>none</args>
 
342
        <p>
 
343
          The <code>get-input-encoding-mode</code> method return the input
 
344
          encoding mode.
 
345
        </p>
 
346
      </meth>
 
347
 
 
348
      <meth>
 
349
        <name>set-output-encoding-mode</name>
 
350
        <retn>none</retn>
 
351
        <args>Item|String</args>
 
352
        <p>
 
353
          The <code>set-output-encoding-mode</code> method sets the output
 
354
          encoding mode. In the first form, with an item, the
 
355
          stream encoding mode is set directly. In the second form, the
 
356
          encoding mode is set with a string and might also alter the
 
357
          stream transcoing mode.
 
358
        </p>
 
359
      </meth>
 
360
 
 
361
      <meth>
 
362
        <name>get-output-encoding-mode</name>
 
363
        <retn>Item</retn>
 
364
        <args>none</args>
 
365
        <p>
 
366
          The <code>get-output-encoding-mode</code> method return the output
 
367
          encoding mode.
 
368
        </p>
 
369
      </meth>
 
370
    </methods>
 
371
  </object>
 
372
 
 
373
  <!-- =================================================================== -->
 
374
  <!-- = tcp socket object                                               = -->
 
375
  <!-- =================================================================== -->
 
376
  
 
377
  <object nameset="afnix:net">
 
378
    <name>TcpSocket</name>
 
379
 
 
380
    <!-- synopsis -->
 
381
    <p>
 
382
      The <code>TcpSocket</code> class is a base class for all tcp
 
383
      socket objects. The class is derived from the <code>Socket</code>
 
384
      class and provides some specific tcp methods. If a
 
385
      <code>TcpSocket</code> is created, the user is responsible to
 
386
      connect it to the proper address and port.
 
387
    </p>
 
388
 
 
389
    <!-- predicate -->
 
390
    <pred>tcp-socket-p</pred>
 
391
 
 
392
    <!-- inheritance -->
 
393
    <inherit>
 
394
      <name>Socket</name>
 
395
    </inherit>
 
396
 
 
397
    <!-- constructors -->
 
398
    <ctors>
 
399
      <ctor>
 
400
        <name>TcpSocket</name>
 
401
        <args>none</args>
 
402
        <p>
 
403
          The <code>TcpSocket</code> constructor creates a new tcp socket.
 
404
        </p>
 
405
      </ctor>
 
406
    </ctors>
 
407
 
 
408
    <!-- methods -->
 
409
    <methods>
 
410
      <meth>
 
411
        <name>accept</name>
 
412
        <retn>TcpSocket</retn>
 
413
        <args>none</args>
 
414
        <p>
 
415
          The <code>accept</code> method waits for incoming connection and
 
416
          returns a <code>TcpSocket</code> object initialized with the
 
417
          connected peer. The result socket can be used to perform i/o
 
418
          operations. This method is used by tcp server.
 
419
        </p>
 
420
      </meth>
 
421
 
 
422
      <meth>
 
423
        <name>listen</name>
 
424
        <retn>Boolean</retn>
 
425
        <args>none|Integer</args>
 
426
        <p>
 
427
          The <code>listen</code> method initialize a socket to accept
 
428
          incoming connection. Without argument, the default number of
 
429
          incoming connection is 5. The integer argument can be used to
 
430
          specify the number of incoming connection that socket is willing
 
431
          to queue. This method is used by tcp server.
 
432
        </p>
 
433
      </meth>
 
434
    </methods>
 
435
  </object>
 
436
 
 
437
  <!-- =================================================================== -->
 
438
  <!-- = tcp client object                                               = -->
 
439
  <!-- =================================================================== -->
 
440
  
 
441
  <object nameset="afnix:net">
 
442
    <name>TcpClient</name>
 
443
 
 
444
    <!-- synopsis -->
 
445
    <p>
 
446
      The <code>TcpClient</code> class creates a tcp client by host and
 
447
      port. The host argument can be either a name or an address
 
448
      object. The port argument is the server port to contact. The
 
449
      <code>TcpClient</code> class is derived from the
 
450
      <code>TcpSocket</code> class. This class has no specific methods.
 
451
    </p>
 
452
 
 
453
    <!-- predicate -->
 
454
    <pred>tcp-client-p</pred>
 
455
 
 
456
    <!-- inheritance -->
 
457
    <inherit>
 
458
      <name>TcpSocket</name>
 
459
    </inherit>
 
460
 
 
461
    <!-- constructors -->
 
462
    <ctors>
 
463
      <ctor>
 
464
        <name>TcpClient</name>
 
465
        <args>String Integer</args>
 
466
        <p>
 
467
          The <code>TcpClient</code> constructor creates a new tcp client
 
468
          socket by host name and port number.
 
469
        </p>
 
470
      </ctor>
 
471
    </ctors>
 
472
  </object>
 
473
  
 
474
  <!-- =================================================================== -->
 
475
  <!-- = tcp server object                                               = -->
 
476
  <!-- =================================================================== -->
 
477
  
 
478
  <object nameset="afnix:net">
 
479
    <name>TcpServer</name>
 
480
 
 
481
    <!-- synopsis -->
 
482
    <p>
 
483
      The <code>TcpServer</code> class creates a tcp server by port. An
 
484
      optional host argument can be either a name or an address
 
485
      object. The port argument is the server port to bind. The
 
486
      <code>TcpServer</code> class is derived from the
 
487
      <code>TcpSocket</code> class. This class has no specific
 
488
      methods. With one argument, the server bind the port argument on
 
489
      the local host. The backlog can be specified as the last
 
490
      argument. The host name can also be specified as the first
 
491
      argument, the port as second argument and eventually the
 
492
      backlog. Note that the host can be either a string or an address
 
493
      object.
 
494
    </p>
 
495
 
 
496
    <!-- predicate -->
 
497
    <pred>tcp-server-p</pred>
 
498
 
 
499
    <!-- inheritance -->
 
500
    <inherit>
 
501
      <name>TcpSocket</name>
 
502
    </inherit>
 
503
 
 
504
    <!-- constructors -->
 
505
    <ctors>
 
506
      <ctor>
 
507
        <name>TcpServer</name>
 
508
        <args>none</args>
 
509
        <p>
 
510
          The <code>TcpServer</code> constructor creates a default tcp
 
511
          server.
 
512
        </p>
 
513
      </ctor>
 
514
 
 
515
      <ctor>
 
516
        <name>TcpServer</name>
 
517
        <args>Integer</args>
 
518
        <p>
 
519
          The <code>TcpServer</code> constructor creates a default tcp
 
520
          server which is bound on the specified port argument.
 
521
        </p>
 
522
      </ctor>
 
523
 
 
524
      <ctor>
 
525
        <name>TcpServer</name>
 
526
        <args>Integer Integer</args>
 
527
        <p>
 
528
          The <code>TcpServer</code> constructor creates a default tcp
 
529
          server which is bound on the specified port argument. The second
 
530
          argument is the backlog value.
 
531
        </p>
 
532
      </ctor>
 
533
 
 
534
      <ctor>
 
535
        <name>TcpServer</name>
 
536
        <args>String Integer</args>
 
537
        <p>
 
538
          The <code>TcpServer</code> constructor creates a tcp server by
 
539
          host name and port number. The first argument is the host
 
540
          name. The second argument is the port number.
 
541
        </p>
 
542
      </ctor>
 
543
 
 
544
      <ctor>
 
545
        <name>TcpServer</name>
 
546
        <args>String Integer Integer</args>
 
547
        <p>
 
548
          The <code>TcpServer</code> constructor creates a tcp server by
 
549
          host name and port number. The first argument is the host
 
550
          name. The second argument is the port number. The third argument
 
551
          is the backlog.
 
552
        </p>
 
553
      </ctor>
 
554
    </ctors>
 
555
  </object>
 
556
 
 
557
  <!-- =================================================================== -->
 
558
  <!-- = datagram object                                                 = -->
 
559
  <!-- =================================================================== -->
 
560
  
 
561
  <object nameset="afnix:net">
 
562
    <name>Datagram</name>
 
563
 
 
564
    <!-- synopsis -->
 
565
    <p>
 
566
      The <code>Datagram</code> class is a socket class used by udp
 
567
      socket. A datagram is constructed by the <code>UdpSocket</code>
 
568
      <code>accept</code> method. The purpose of a datagram is to store
 
569
      the peer information so one can reply to the sender. The datagram
 
570
      also stores in a buffer the data sent by the peer. This class does
 
571
      not have any constructor nor any specific method.
 
572
    </p>
 
573
 
 
574
    <!-- predicate -->
 
575
    <pred>datagram-p</pred>
 
576
 
 
577
    <!-- inheritance -->
 
578
    <inherit>
 
579
      <name>Socket</name>
 
580
    </inherit>
 
581
  </object>
 
582
 
 
583
  <!-- =================================================================== -->
 
584
  <!-- = udp socket object                                               = -->
 
585
  <!-- =================================================================== -->
 
586
  
 
587
  <object nameset="afnix:net">
 
588
    <name>UdpSocket</name>
 
589
 
 
590
    <!-- synopsis -->
 
591
    <p>
 
592
      The <code>UdpSocket</code> class is a base class for all udp
 
593
      socket objects. The class is derived from the <code>Socket</code>
 
594
      class and provides some specific udp methods.
 
595
    </p>
 
596
 
 
597
    <!-- predicate -->
 
598
    <pred>udp-socket-p</pred>
 
599
 
 
600
    <!-- inheritance -->
 
601
    <inherit>
 
602
      <name>Socket</name>
 
603
    </inherit>
 
604
 
 
605
    <!-- constructors -->
 
606
    <ctors>
 
607
      <ctor>
 
608
        <name>UdpSocket</name>
 
609
        <args>none</args>
 
610
        <p>
 
611
          The <code>UdpSocket</code> constructor creates a new udp socket.
 
612
        </p>
 
613
      </ctor>
 
614
    </ctors>
 
615
 
 
616
    <!-- methods -->
 
617
    <methods>
 
618
      <meth>
 
619
        <name>accept</name>
 
620
        <retn>Datagram</retn>
 
621
        <args>none</args>
 
622
        <p>
 
623
          The <code>accept</code> method waits for an incoming datagram
 
624
          and returns a <code>Datagram</code> object. The datagram is
 
625
          initialized with the peer address and port as well as the
 
626
          incoming data.
 
627
        </p>
 
628
      </meth>
 
629
    </methods>
 
630
  </object>
 
631
 
 
632
  <!-- =================================================================== -->
 
633
  <!-- = udp client object                                               = -->
 
634
  <!-- =================================================================== -->
 
635
  
 
636
  <object nameset="afnix:net">
 
637
    <name>UdpClient</name>
 
638
 
 
639
    <!-- synopsis -->
 
640
    <p>
 
641
      The <code>UdpClient</code> class creates a udp client by host and
 
642
      port. The host argument can be either a name or an address
 
643
      object. The port argument is the server port to contact. The
 
644
      <code>UdpClient</code> class is derived from the
 
645
      <code>UdpSocket</code> class. This class has no specific methods.
 
646
    </p>
 
647
 
 
648
    <!-- predicate -->
 
649
    <pred>udp-client-p</pred>
 
650
 
 
651
    <!-- inheritance -->
 
652
    <inherit>
 
653
      <name>UdpSocket</name>
 
654
    </inherit>
 
655
 
 
656
    <!-- constructors -->
 
657
    <ctors>
 
658
      <ctor>
 
659
        <name>UdpClient</name>
 
660
        <args>String Integer</args>
 
661
        <p>
 
662
          The <code>UdpClient</code> constructor creates a new udp client
 
663
          by host and port. The first argument is the host name. The
 
664
          second argument is the port number.
 
665
        </p>
 
666
      </ctor>
 
667
    </ctors>
 
668
  </object>
 
669
 
 
670
  <!-- =================================================================== -->
 
671
  <!-- = udp server object                                               = -->
 
672
  <!-- =================================================================== -->
 
673
  
 
674
  <object nameset="afnix:net">
 
675
    <name>UdpServer</name>
 
676
 
 
677
    <!-- synopsis -->
 
678
    <p>
 
679
      The <code>UdpServer</code> class creates a udp server by port. An
 
680
      optional host argument can be either a name or an address
 
681
      object. The port argument is the server port to bind. The
 
682
      <code>UdpServer</code> class is derived from the
 
683
      <code>UdpSocket</code> class. This class has no specific
 
684
      methods. With one argument, the server bind the port argument on
 
685
      the local host. The host name can also be specified as the first
 
686
      argument, the port as second argument. Note that the host can be
 
687
      either a string or an address object.
 
688
    </p>
 
689
 
 
690
    <!-- predicate -->
 
691
    <pred>udp-server-p</pred>
 
692
 
 
693
    <!-- inheritance -->
 
694
    <inherit>
 
695
      <name>UdpSocket</name>
 
696
    </inherit>
 
697
 
 
698
    <!-- constructors -->
 
699
    <ctors>
 
700
      <ctor>
 
701
        <name>UdpServer</name>
 
702
        <args>none</args>
 
703
        <p>
 
704
          The <code>UdpServer</code> constructor creates a default udp
 
705
          server object.
 
706
        </p>
 
707
      </ctor>
 
708
 
 
709
      <ctor>
 
710
        <name>UdpServer</name>
 
711
        <args>String|Address</args>
 
712
        <p>
 
713
          The <code>UdpServer</code> constructor creates a udp server
 
714
          object by host. The first argument is the host name or host address.
 
715
        </p>
 
716
      </ctor>
 
717
 
 
718
      <ctor>
 
719
        <name>UdpServer</name>
 
720
        <args>String|Address Integer</args>
 
721
        <p>
 
722
          The <code>UdpServer</code> constructor creates a udp server
 
723
          object by host and port. The first argument is the host name or
 
724
          host address. The second argument is the port number.
 
725
        </p>
 
726
      </ctor>
 
727
    </ctors>
 
728
  </object>
 
729
 
 
730
  <!-- =================================================================== -->
 
731
  <!-- = multicast object                                                = -->
 
732
  <!-- =================================================================== -->
 
733
  
 
734
  <object nameset="afnix:net">
 
735
    <name>Multicast</name>
 
736
 
 
737
    <!-- synopsis -->
 
738
    <p>
 
739
      The <code>Multicast</code> class creates a udp multicast socket by
 
740
      port. An optional host argument can be either a name or an address
 
741
      object. The port argument is the server port to bind. The
 
742
      <code>Multicast</code> class is derived from the
 
743
      <code>UdpSocket</code> class. This class has no specific
 
744
      methods. With one argument, the server bind the port argument on
 
745
      the local host. The host name can also be specified as the first
 
746
      argument, the port as second argument. Note that the host can be
 
747
      either a string or an address object. This class is similar to the
 
748
      <code>UdpServer</code> class, except that the socket join the
 
749
      multicast group at construction and leave it at destruction.
 
750
    </p>
 
751
 
 
752
    <!-- predicate -->
 
753
    <pred>multicast-p</pred>
 
754
 
 
755
    <!-- inheritance -->
 
756
    <inherit>
 
757
      <name>UdpSocket</name>
 
758
    </inherit>
 
759
 
 
760
    <!-- constructors -->
 
761
    <ctors>
 
762
      <ctor>
 
763
        <name>Multicast</name>
 
764
        <args>String|Address</args>
 
765
        <p>
 
766
          The <code>Multicast</code> constructor creates a multicast socket
 
767
          object by host. The first argument is the host name or host address.
 
768
        </p>
 
769
      </ctor>
 
770
 
 
771
      <ctor>
 
772
        <name>Multicast</name>
 
773
        <args>String|Address Integer</args>
 
774
        <p>
 
775
          The <code>Multicast</code> constructor creates a multicast socket
 
776
          object by host and port. The first argument is the host name or
 
777
          host address. The second argument is the port number.
 
778
        </p>
 
779
      </ctor>
 
780
    </ctors>
192
781
  </object>
193
782
</appendix>