Next: Local (Unix) Domain Sockets, Previous: Socket Options, Up: Networking

### 14.4 INET Domain Sockets

The TCP and UDP sockets that you know and love. Some representation issues:

- Internet addresses are represented by vectors of (unsigned-byte 8) - viz. #(127 0 0 1). Ports are just integers: 6010. No conversion between network- and host-order data is needed from the user of this package.
- Socket addresses are represented by the two values for address and port, so for example, (socket-connect s #(192 168 1 1) 80).

— Class: sb-bsd-sockets:inet-socket

> Class precedence list: `inet-socket, socket, standard-object, t`

> Class representing `tcp` and `udp` sockets.

> Examples:

>                (make-instance 'inet-socket :type :stream :protocol :tcp)

>                (make-instance 'inet-socket :type :datagram :protocol :udp)

— Function: sb-bsd-sockets:make-inet-address dotted-quads

> Return a vector of octets given a string `dotted-quads` in the format "127.0.0.1". Signals an error if the string is malformed.

— Function: sb-bsd-sockets:get-protocol-by-name name

> Returns the network protocol number associated with the string `name`, using getprotobyname(2) which typically looks in `nis` or /etc/protocols