address-info

Check-in [e677329d3d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:initial documentation
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e677329d3d6ed5fed17195de9f027c7c132c990b3624c5d735bf44025d9330c7
User & Date: murphy 2017-08-21 22:54:05
Context
2017-08-21
23:20
updated release information file check-in: de9e102759 user: murphy tags: trunk, v1.0.0
22:54
initial documentation check-in: e677329d3d user: murphy tags: trunk
22:24
initial working code check-in: c3946a8616 user: murphy tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added address-info.wiki.











































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
<h1>Address Info API</h1>

This CHICKEN module exposes <tt>getaddrinfo(3)</tt> functionality to Scheme.

<verbatim>
  (require-extension address-info)
</verbatim>

<h2>Address Info Record</h2>

<verbatim>
  (define-record-type address-info
    (make-address-info family type host port)
    address-info?
    [family address-info-family]
    [type address-info-type]
    [host address-info-host]
    [port address-info-port])
</verbatim>

Descriptor for an internet socket address. The family is either
<tt>'ipv4</tt> or <tt>'ipv6</tt>. The type is either <tt>'tcp</tt>,
<tt>'udp</tt> or <tt>'raw</tt>. The host is a numeric address encoded as
a string. The port is a either a positive integer or <tt>#f</tt>.

<h2>Address Info Lookup</h2>

<verbatim>
  (address-infos
   HOST [#:port PORT]
   [#:family FAMILY] [#:type TYPE]
   [#:server? BOOLEAN] [#:numeric? BOOLEAN])
  => (list ADDRESS-INFO ...) | #f
</verbatim>

Tries to lookup socket addresses for the given host and/or port. If the
lookup is successful, the procedure returns a list of address
information records. Otherwise it returns <tt>#f</tt>.

For a successful lookup you must at least specify a hostname or a port.
If no hostname is specified, the function defaults to server mode lookup
and will return wildcard addresses. This behaviour can be changed using
the <tt>#:server?</tt> flag.

By default, the procedure will return address information records for
all suitable supported protocol families and socket types. The
<tt>#:family</tt> argument may be used to filter for <tt>'ipv4</tt> or
<tt>'ipv6</tt> addresses. The <tt>#:type</tt> argument may be used to
filter for <tt>'tcp</tt> / <tt>'stream</tt>, <tt>'udp</tt> /
<tt>'datagram</tt> or <tt>'raw</tt> socket types.

Unless the <tt>#:numeric?</tt> flag is set to a true value, the
procedure will convert hostnames into numeric network addresses.