cimport libc
cdef class sockaddr :
"""
A network-level socket address
>>> sockaddr().family
0
>>> sockaddr().port
Traceback (most recent call last):
...
NotImplementedError
>>> sockaddr().getnameinfo()
Traceback (most recent call last):
...
NotImplementedError
"""
# address family
# XXX: this should be a class constant! It's part of our type safety!
cdef readonly libc.sa_family_t family
cdef void _init_family (self, libc.sa_family_t family=?)
# get the sockaddr/socklen
# each of these can be NULL to ignore it
cdef int _get_sockaddr (self, libc.sockaddr **sa_ptr, libc.socklen_t *sa_len) except -1