Data properties |
Describe |
Af_unix,af_inet,af_inet6 |
Python-Supported socket families |
Sock_stream,sock_dgram |
Socket type (tcp= stream, udp= datagram) |
Has_ipv6 |
Flag variable indicating whether IPV6 is supported |
exception |
description |
error |
|
herror |
host and address-related errors |
address-related error |
timeout |
/tbody>
Function |
Describe |
Socket () |
Create a Socket object |
Socketpair () |
Create a pair of sockets |
FROMFD () |
Create a socket object with an open file descriptor |
Data properties |
Describe |
SSL () |
Initializes a secure Sockets layer on the socket. Do not verify the certificate |
Getaddrinfo () |
Get address information |
Getfqdn () |
Returns the name of the full domain |
GetHostName () |
Get the current host name |
GetHostByName () |
The corresponding IP address is obtained by host name |
GETHOSTBYNAME_EX () |
Extended version of GetHostByName (), returns host name, all aliases and IP address list of host |
GETHOSTBYADDR () |
Get DNS information from IP address, return a 3-tuple similar to GETHOSTBYNAME_EX () |
Getservbyname ()/getservbyport () |
Get the corresponding port number or vice versa by the service name |
getprotobyname () |
by protocol name (e.g. ' TCP ' ) to get the corresponding number |
Data properties |
Describe |
Ntohl ()/ntohs () |
Convert an integer from network byte order to host byte order
|
Htonl ()/htons () |
Convert an integer from host byte order to network byte order |
Inet_aton ()/inet_ntoa () |
Convert IP address to 32-bit integer, and inverse function |
Inet_pton ()/inet_ntop () |
Convert IP address into binary format and inverse function |
Getdefaulttimeout ()/setdefaulttimeout () |
Get/Set Default socket time-out |
The socket module properties in Python