inc/addr.pxd
changeset 1 0ca9278146d7
child 2 171e77f8d675
equal deleted inserted replaced
0:975801b28d85 1:0ca9278146d7
       
     1 cimport libc
       
     2 
       
     3 cdef class sockaddr :
       
     4     """
       
     5         A network-level socket address
       
     6 
       
     7         >>> sockaddr().family
       
     8         0
       
     9         >>> sockaddr().port
       
    10         Traceback (most recent call last):
       
    11           ...
       
    12         NotImplementedError
       
    13         >>> sockaddr().getnameinfo()
       
    14         Traceback (most recent call last):
       
    15           ...
       
    16         NotImplementedError
       
    17     """
       
    18     
       
    19     # address family
       
    20     # XXX: this should be a class constant! It's part of our type safety!
       
    21     cdef readonly libc.sa_family_t family
       
    22 
       
    23     cdef void _init_family (self, libc.sa_family_t family=?)
       
    24 
       
    25     # get the sockaddr/socklen
       
    26     # each of these can be NULL to ignore it
       
    27     cdef int _get_sockaddr (self, libc.sockaddr **sa_ptr, libc.socklen_t *sa_len) except -1
       
    28