socket object
|
fromfd(fd,
family,
type,
proto=...)
Create a socket object from a duplicate of the given file descriptor. |
|
|
list of (family, socktype, proto, canonname, sockaddr)
|
getaddrinfo(host,
port,
family=...,
socktype=...,
proto=...,
flags=...)
Resolve host and port into addrinfo struct. |
|
|
timeout
|
getdefaulttimeout()
Returns the default timeout in floating seconds for new socket
objects. |
|
|
(name, aliaslist, addresslist)
|
gethostbyaddr(host)
Return the true host name, a list of aliases, and a list of IP
addresses, for a host. |
|
|
address
|
gethostbyname(host)
Return the IP address (a string of the form '255.255.255.255') for a
host. |
|
|
(name, aliaslist, addresslist)
|
gethostbyname_ex(host)
Return the true host name, a list of aliases, and a list of IP
addresses, for a host. |
|
|
string
|
gethostname()
Return the current host name. |
|
|
|
getnameinfo(...)
getnameinfo(sockaddr, flags) --> (host, port) |
|
|
integer
|
getprotobyname(name)
Return the protocol number for the named protocol. |
|
|
integer
|
getservbyname(servicename,
protocolname=...)
Return a port number from a service name and protocol name. |
|
|
string
|
getservbyport(port,
protocolname=...)
Return the service name from a port number and protocol name. |
|
|
integer
|
htonl(integer)
Convert a 32-bit integer from host to network byte order. |
|
|
integer
|
htons(integer)
Convert a 16-bit integer from host to network byte order. |
|
|
packed 32-bit IP representation
|
inet_aton(string)
Convert an IP address in string format (123.45.67.89) to the 32-bit
packed binary format used in low-level network functions. |
|
|
ip_address_string
|
inet_ntoa(packed_ip)
Convert an IP address from 32-bit packed binary format to string
format |
|
|
string formatted IP address
|
inet_ntop(af,
packed_ip)
Convert a packed IP address of the given family to string format. |
|
|
packed IP address string
|
inet_pton(af,
ip)
Convert an IP address from string format to a packed string suitable
for use with low-level network functions. |
|
|
integer
|
ntohl(integer)
Convert a 32-bit integer from network to host byte order. |
|
|
integer
|
ntohs(integer)
Convert a 16-bit integer from network to host byte order. |
|
|
|
setdefaulttimeout(timeout)
Set the default timeout in floating seconds for new socket objects. |
|
|
(socket object, socket object)
|
socketpair(family=...,
type=...,
proto=...=...)
Create a pair of socket objects from the sockets returned by the
platform socketpair() function. |
|
|