[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.11.1 Socket address

Builtin Class: <sockaddr>
An abstract base class of socket addresses. Each socket address family is implemented as a subclass of this class.

Although socket addresses are built-in classes, you can use make method to create an instance of a specific socket address family.

Generic Function: sockaddr-family addr
Returns a symbol that indicates the family of the socket address addr.

Generic Function: sockaddr-name addr
Returns a string which represents the content of the socket address addr.

Builtin Class: <sockaddr-in>
AF_INET family socket address. To create an instance of this class, use make method as follows:
 
(make <sockaddr-in> :host host :port port)
host can be a string, or one of the keywords :any, :broadcast, :none or :loopback. If it is a string, it is either a host name or a dotted IP notation. Gauche uses gethostbyname(3) to obtain the actual IP address from host parameter. If it is a keyword :any, or :broadcast, the address uses INADDR_ANY, or INADDR_BROADCAST respectively. The keyword :loopback is a synonym to the IPv4 loopback address "127.0.0.1".

port must be a positive integer indicating the port number.

Method: sockaddr-family (addr <sockaddr-in>)
Returns a symbol inet.

Method: sockaddr-name (addr <sockaddr-in>)
Returns a string in the form "a.b.c.d:port", where "a.b.c.d" is dotted decimal notion of the IP address and port is the port number.

Builtin Class: <sockaddr-un>
AF_UNIX family socket address. To create an instance of this class, use make method as follows:
 
(make <sockaddr-un> :path path)
path must be a string specifying pathname of the socket.

Method: sockaddr-family (addr <sockaddr-un>)
Returns a symbol unix.

Method: sockaddr-name (addr <sockaddr-un>)
Returns a pathname of the socket address.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Ken Dickey on November, 28 2002 using texi2html