[ Home ]
SBCL Internals

The pages on this CLiki-driven site can be edited by anybody at any time. No warranty of any kind can therefore be made; any implied warranties of merchantability or fitness for a particular purpose are expressly disclaimed
[ Home ] [ Recent Changes ] [ About CLiki ] [ Text Formatting ]

SB-BSD-SOCKETS sockets can be implemented by subclassing SOCKET and supplying a default value for the family slot. This value is going to be based on something available from SOCKINT and currently both sockint::af-local and sockint::af-inet are implemented.

The main difference between Address Families is of course the associated "struct sockaddr" that C has for each. These come in different sizes, so each socket call that accepts a sockaddr has to know its size as well.

4 Generic functions are defined:

MAKE-SOCKADDR-FOR socket &optional sockaddr &rest address

Specialize socket on your class, you are supplied a sockaddr foreign object or nil meaning to allocate one, and the address is whatever you define for this family.

The job of this function is to create or re-use a proper sockaddr foreign struct, and populate it with the address values supplied, then return it.

FREE-SOCKADDR-FOR socket sockaddr

Specialize socket on your class and use the family appropriate foreign free function on the sockaddr foreign struct.

SIZE-OF-SOCKADDR socket

Specialize socket on your class and return the length of the family appropriate foreign sockaddr struct.

BITS-OF-SOCKADDR socket sockaddr

The name is a bit misleading, but you are supposed to specialize on socket and then extract the "address" from the foreign sockaddr struct, the opposite of what MAKE-SOCKADDR-FOR does.


This page is presently Uncategorized?: please add appropriate topic markers? and remove this text

This page is linked from: SB-BSD-SOCKETS  

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively