equal
deleted
inserted
replaced
51 """ |
51 """ |
52 A socket-level endpoint address, which contains the full socket parameters and an bind/connect address. |
52 A socket-level endpoint address, which contains the full socket parameters and an bind/connect address. |
53 |
53 |
54 A full addrinfo struct is stored, but ai_canonname and ai_addr are stored as (optional) objects outside of the |
54 A full addrinfo struct is stored, but ai_canonname and ai_addr are stored as (optional) objects outside of the |
55 addrinfo struct. |
55 addrinfo struct. |
56 |
56 |
|
57 >>> from qmsk.net.socket import af_inet |
57 >>> ai = addrinfo() |
58 >>> ai = addrinfo() |
58 >>> ai.addr |
59 >>> ai.addr |
59 >>> ai.canonname |
60 >>> ai.canonname |
60 >>> print addrinfo(addr=sockaddr_in()) |
61 >>> print addrinfo(addr=af_inet.sockaddr_in()) |
61 family=0, socktype=0, protocol=0, addr=0.0.0.0:0, canonname=None |
62 family=0, socktype=0, protocol=0, addr=0.0.0.0:0, canonname=None |
62 """ |
63 """ |
63 |
64 |
64 # canonname is not stored |
65 # canonname is not stored |
65 # may be NULL |
66 # may be NULL |
106 'family=10, socktype=1, protocol=6, addr=[2001::5]:80, canonname=None' |
107 'family=10, socktype=1, protocol=6, addr=[2001::5]:80, canonname=None' |
107 |
108 |
108 """ |
109 """ |
109 |
110 |
110 # our defining attributes, set via __init__ |
111 # our defining attributes, set via __init__ |
111 cdef object hostname, service |
112 cdef public object hostname, service |
112 |
113 |
113 cpdef getaddrinfo (self, int family, int socktype, int protocol = ?, int flags = ?) |
114 cpdef getaddrinfo (self, int family, int socktype, int protocol = ?, int flags = ?) |
114 |
115 |