Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Python 3.11.3

Contenu du module « socket »

Liste des classes du module socket

Nom de la classe Description
AddressFamily An enumeration. [extrait de AddressFamily.__doc__]
AddressInfo An enumeration. [extrait de AddressInfo.__doc__]
IntEnum
IntFlag
MsgFlag An enumeration. [extrait de MsgFlag.__doc__]
socket A subclass of _socket.socket adding the makefile() method. [extrait de socket.__doc__]
SocketIO Raw I/O implementation for stream sockets. [extrait de SocketIO.__doc__]
SocketKind An enumeration. [extrait de SocketKind.__doc__]

Liste des exceptions du module socket

Nom de la classe d'exception Description
gaierror
herror

Liste des fonctions du module socket

Signature de la fonction Description
close close(integer) -> None [extrait de close.__doc__]
CMSG_LEN CMSG_LEN(length) -> control message length [extrait de CMSG_LEN.__doc__]
CMSG_SPACE CMSG_SPACE(length) -> buffer size [extrait de CMSG_SPACE.__doc__]
create_connection(address, timeout=<object object at 0x7f721bac45e0>, source_address=None, *, all_errors=False) Connect to *address* and return the socket object. [extrait de create_connection.__doc__]
create_server(address, *, family=<AddressFamily.AF_INET: 2>, backlog=None, reuse_port=False, dualstack_ipv6=False) Convenience function which creates a SOCK_STREAM type socket [extrait de create_server.__doc__]
dup dup(integer) -> integer [extrait de dup.__doc__]
fromfd(fd, family, type, proto=0) fromfd(fd, family, type[, proto]) -> socket object [extrait de fromfd.__doc__]
getaddrinfo(host, port, family=0, type=0, proto=0, flags=0) Resolve host and port into list of address info entries. [extrait de getaddrinfo.__doc__]
getdefaulttimeout getdefaulttimeout() -> timeout [extrait de getdefaulttimeout.__doc__]
getfqdn(name='') Get fully qualified domain name from name. [extrait de getfqdn.__doc__]
gethostbyaddr gethostbyaddr(host) -> (name, aliaslist, addresslist) [extrait de gethostbyaddr.__doc__]
gethostbyname gethostbyname(host) -> address [extrait de gethostbyname.__doc__]
gethostbyname_ex gethostbyname_ex(host) -> (name, aliaslist, addresslist) [extrait de gethostbyname_ex.__doc__]
gethostname gethostname() -> string [extrait de gethostname.__doc__]
getnameinfo getnameinfo(sockaddr, flags) --> (host, port) [extrait de getnameinfo.__doc__]
getprotobyname getprotobyname(name) -> integer [extrait de getprotobyname.__doc__]
getservbyname getservbyname(servicename[, protocolname]) -> integer [extrait de getservbyname.__doc__]
getservbyport getservbyport(port[, protocolname]) -> string [extrait de getservbyport.__doc__]
has_dualstack_ipv6() Return True if the platform supports creating a SOCK_STREAM socket [extrait de has_dualstack_ipv6.__doc__]
htonl htonl(integer) -> integer [extrait de htonl.__doc__]
htons htons(integer) -> integer [extrait de htons.__doc__]
if_indextoname if_indextoname(if_index) [extrait de if_indextoname.__doc__]
if_nameindex if_nameindex() [extrait de if_nameindex.__doc__]
if_nametoindex if_nametoindex(if_name) [extrait de if_nametoindex.__doc__]
inet_aton inet_aton(string) -> bytes giving packed 32-bit IP representation [extrait de inet_aton.__doc__]
inet_ntoa inet_ntoa(packed_ip) -> ip_address_string [extrait de inet_ntoa.__doc__]
inet_ntop inet_ntop(af, packed_ip) -> string formatted IP address [extrait de inet_ntop.__doc__]
inet_pton inet_pton(af, ip) -> packed IP address string [extrait de inet_pton.__doc__]
ntohl ntohl(integer) -> integer [extrait de ntohl.__doc__]
ntohs ntohs(integer) -> integer [extrait de ntohs.__doc__]
recv_fds(sock, bufsize, maxfds, flags=0) recv_fds(sock, bufsize, maxfds[, flags]) -> (data, list of file [extrait de recv_fds.__doc__]
send_fds(sock, buffers, fds, flags=0, address=None) send_fds(sock, buffers, fds[, flags[, address]]) -> integer [extrait de send_fds.__doc__]
setdefaulttimeout setdefaulttimeout(timeout) [extrait de setdefaulttimeout.__doc__]
sethostname sethostname(name) [extrait de sethostname.__doc__]
socketpair(family=None, type=<SocketKind.SOCK_STREAM: 1>, proto=0) socketpair([family[, type[, proto]]]) -> (socket object, socket object) [extrait de socketpair.__doc__]

Liste des variables globales du module socket

Nom de la variable globale Valeur
AF_ALG 38
AF_APPLETALK 5
AF_ASH 18
AF_ATMPVC 8
AF_ATMSVC 20
AF_AX25 3
AF_BLUETOOTH 31
AF_BRIDGE 7
AF_CAN 29
AF_DECnet 12
AF_ECONET 19
AF_INET 2
AF_INET6 10
AF_IPX 4
AF_IRDA 23
AF_KEY 15
AF_LLC 26
AF_NETBEUI 13
AF_NETLINK 16
AF_NETROM 6
AF_PACKET 17
AF_PPPOX 24
AF_QIPCRTR 42
AF_RDS 21
AF_ROSE 11
AF_ROUTE 16
AF_SECURITY 14
AF_SNA 22
AF_TIPC 30
AF_UNIX 1
AF_UNSPEC 0
AF_VSOCK 40
AF_WANPIPE 25
AF_X25 9
AI_ADDRCONFIG 32
AI_ALL 16
AI_CANONNAME 2
AI_NUMERICHOST 4
AI_NUMERICSERV 1024
AI_PASSIVE 1
AI_V4MAPPED 8
ALG_OP_DECRYPT 0
ALG_OP_ENCRYPT 1
ALG_OP_SIGN 2
ALG_OP_VERIFY 3
ALG_SET_AEAD_ASSOCLEN 4
ALG_SET_AEAD_AUTHSIZE 5
ALG_SET_IV 2
ALG_SET_KEY 1
ALG_SET_OP 3
ALG_SET_PUBKEY 6
BDADDR_ANY 00:00:00:00:00:00
BDADDR_LOCAL 00:00:00:FF:FF:FF
BTPROTO_HCI 1
BTPROTO_L2CAP 0
BTPROTO_RFCOMM 3
BTPROTO_SCO 2
CAN_BCM 2
CAN_BCM_CAN_FD_FRAME 2048
CAN_BCM_RX_ANNOUNCE_RESUME 256
CAN_BCM_RX_CHANGED 12
CAN_BCM_RX_CHECK_DLC 64
CAN_BCM_RX_DELETE 6
CAN_BCM_RX_FILTER_ID 32
CAN_BCM_RX_NO_AUTOTIMER 128
CAN_BCM_RX_READ 7
CAN_BCM_RX_RTR_FRAME 1024
CAN_BCM_RX_SETUP 5
CAN_BCM_RX_STATUS 10
CAN_BCM_RX_TIMEOUT 11
CAN_BCM_SETTIMER 1
CAN_BCM_STARTTIMER 2
CAN_BCM_TX_ANNOUNCE 8
CAN_BCM_TX_COUNTEVT 4
CAN_BCM_TX_CP_CAN_ID 16
CAN_BCM_TX_DELETE 2
CAN_BCM_TX_EXPIRED 9
CAN_BCM_TX_READ 3
CAN_BCM_TX_RESET_MULTI_IDX 512
CAN_BCM_TX_SEND 4
CAN_BCM_TX_SETUP 1
CAN_BCM_TX_STATUS 8
CAN_EFF_FLAG 2147483648
CAN_EFF_MASK 536870911
CAN_ERR_FLAG 536870912
CAN_ERR_MASK 536870911
CAN_ISOTP 6
CAN_J1939 7
CAN_RAW 1
CAN_RAW_FD_FRAMES 5
CAN_RAW_FILTER 1
CAN_RAW_JOIN_FILTERS 6
CAN_RAW_LOOPBACK 3
CAN_RAW_RECV_OWN_MSGS 4
CAN_RTR_FLAG 1073741824
CAN_SFF_MASK 2047
CAPI <capsule object "_socket.CAPI" at 0x7f720e2958f0>
EAGAIN 11
EAI_ADDRFAMILY -9
EAI_AGAIN -3
EAI_BADFLAGS -1
EAI_FAIL -4
EAI_FAMILY -6
EAI_MEMORY -10
EAI_NODATA -5
EAI_NONAME -2
EAI_OVERFLOW -12
EAI_SERVICE -8
EAI_SOCKTYPE -7
EAI_SYSTEM -11
EBADF 9
EWOULDBLOCK 11
has_ipv6 True
HCI_DATA_DIR 1
HCI_FILTER 2
HCI_TIME_STAMP 3
INADDR_ALLHOSTS_GROUP 3758096385
INADDR_ANY 0
INADDR_BROADCAST 4294967295
INADDR_LOOPBACK 2130706433
INADDR_MAX_LOCAL_GROUP 3758096639
INADDR_NONE 4294967295
INADDR_UNSPEC_GROUP 3758096384
IOCTL_VM_SOCKETS_GET_LOCAL_CID 1977
IP_ADD_MEMBERSHIP 35
IP_BIND_ADDRESS_NO_PORT 24
IP_DEFAULT_MULTICAST_LOOP 1
IP_DEFAULT_MULTICAST_TTL 1
IP_DROP_MEMBERSHIP 36
IP_HDRINCL 3
IP_MAX_MEMBERSHIPS 20
IP_MULTICAST_IF 32
IP_MULTICAST_LOOP 34
IP_MULTICAST_TTL 33
IP_OPTIONS 4
IP_RECVOPTS 6
IP_RECVRETOPTS 7
IP_RECVTOS 13
IP_RETOPTS 7
IP_TOS 1
IP_TRANSPARENT 19
IP_TTL 2
IPPORT_RESERVED 1024
IPPORT_USERRESERVED 5000
IPPROTO_AH 51
IPPROTO_DSTOPTS 60
IPPROTO_EGP 8
IPPROTO_ESP 50
IPPROTO_FRAGMENT 44
IPPROTO_GRE 47
IPPROTO_HOPOPTS 0
IPPROTO_ICMP 1
IPPROTO_ICMPV6 58
IPPROTO_IDP 22
IPPROTO_IGMP 2
IPPROTO_IP 0
IPPROTO_IPIP 4
IPPROTO_IPV6 41
IPPROTO_MPTCP 262
IPPROTO_NONE 59
IPPROTO_PIM 103
IPPROTO_PUP 12
IPPROTO_RAW 255
IPPROTO_ROUTING 43
IPPROTO_RSVP 46
IPPROTO_SCTP 132
IPPROTO_TCP 6
IPPROTO_TP 29
IPPROTO_UDP 17
IPPROTO_UDPLITE 136
IPV6_CHECKSUM 7
IPV6_DONTFRAG 62
IPV6_DSTOPTS 59
IPV6_HOPLIMIT 52
IPV6_HOPOPTS 54
IPV6_JOIN_GROUP 20
IPV6_LEAVE_GROUP 21
IPV6_MULTICAST_HOPS 18
IPV6_MULTICAST_IF 17
IPV6_MULTICAST_LOOP 19
IPV6_NEXTHOP 9
IPV6_PATHMTU 61
IPV6_PKTINFO 50
IPV6_RECVDSTOPTS 58
IPV6_RECVHOPLIMIT 51
IPV6_RECVHOPOPTS 53
IPV6_RECVPATHMTU 60
IPV6_RECVPKTINFO 49
IPV6_RECVRTHDR 56
IPV6_RECVTCLASS 66
IPV6_RTHDR 57
IPV6_RTHDR_TYPE_0 0
IPV6_RTHDRDSTOPTS 55
IPV6_TCLASS 67
IPV6_UNICAST_HOPS 16
IPV6_V6ONLY 26
J1939_EE_INFO_NONE 0
J1939_EE_INFO_TX_ABORT 1
J1939_FILTER_MAX 512
J1939_IDLE_ADDR 254
J1939_MAX_UNICAST_ADDR 253
J1939_NLA_BYTES_ACKED 1
J1939_NLA_PAD 0
J1939_NO_ADDR 255
J1939_NO_NAME 0
J1939_NO_PGN 262144
J1939_PGN_ADDRESS_CLAIMED 60928
J1939_PGN_ADDRESS_COMMANDED 65240
J1939_PGN_MAX 262143
J1939_PGN_PDU1_MAX 261888
J1939_PGN_REQUEST 59904
MSG_CMSG_CLOEXEC 1073741824
MSG_CONFIRM 2048
MSG_CTRUNC 8
MSG_DONTROUTE 4
MSG_DONTWAIT 64
MSG_EOR 128
MSG_ERRQUEUE 8192
MSG_FASTOPEN 536870912
MSG_MORE 32768
MSG_NOSIGNAL 16384
MSG_OOB 1
MSG_PEEK 2
MSG_TRUNC 32
MSG_WAITALL 256
NETLINK_CRYPTO 21
NETLINK_DNRTMSG 14
NETLINK_FIREWALL 3
NETLINK_IP6_FW 13
NETLINK_NFLOG 5
NETLINK_ROUTE 0
NETLINK_USERSOCK 2
NETLINK_XFRM 6
NI_DGRAM 16
NI_MAXHOST 1025
NI_MAXSERV 32
NI_NAMEREQD 8
NI_NOFQDN 4
NI_NUMERICHOST 1
NI_NUMERICSERV 2
PACKET_BROADCAST 1
PACKET_FASTROUTE 6
PACKET_HOST 0
PACKET_LOOPBACK 5
PACKET_MULTICAST 2
PACKET_OTHERHOST 3
PACKET_OUTGOING 4
PF_CAN 29
PF_PACKET 17
PF_RDS 21
SCM_CREDENTIALS 2
SCM_J1939_DEST_ADDR 1
SCM_J1939_DEST_NAME 2
SCM_J1939_ERRQUEUE 4
SCM_J1939_PRIO 3
SCM_RIGHTS 1
SHUT_RD 0
SHUT_RDWR 2
SHUT_WR 1
SO_ACCEPTCONN 30
SO_BINDTODEVICE 25
SO_BROADCAST 6
SO_DEBUG 1
SO_DOMAIN 39
SO_DONTROUTE 5
SO_ERROR 4
SO_INCOMING_CPU 49
SO_J1939_ERRQUEUE 4
SO_J1939_FILTER 1
SO_J1939_PROMISC 2
SO_J1939_SEND_PRIO 3
SO_KEEPALIVE 9
SO_LINGER 13
SO_MARK 36
SO_OOBINLINE 10
SO_PASSCRED 16
SO_PASSSEC 34
SO_PEERCRED 17
SO_PEERSEC 31
SO_PRIORITY 12
SO_PROTOCOL 38
SO_RCVBUF 8
SO_RCVLOWAT 18
SO_RCVTIMEO 20
SO_REUSEADDR 2
SO_REUSEPORT 15
SO_SNDBUF 7
SO_SNDLOWAT 19
SO_SNDTIMEO 21
SO_TYPE 3
SO_VM_SOCKETS_BUFFER_MAX_SIZE 2
SO_VM_SOCKETS_BUFFER_MIN_SIZE 1
SO_VM_SOCKETS_BUFFER_SIZE 0
SOCK_CLOEXEC 524288
SOCK_DGRAM 2
SOCK_NONBLOCK 2048
SOCK_RAW 3
SOCK_RDM 4
SOCK_SEQPACKET 5
SOCK_STREAM 1
SOL_ALG 279
SOL_CAN_BASE 100
SOL_CAN_RAW 101
SOL_HCI 0
SOL_IP 0
SOL_RDS 276
SOL_SOCKET 1
SOL_TCP 6
SOL_TIPC 271
SOL_UDP 17
SOMAXCONN 4096
TCP_CONGESTION 13
TCP_CORK 3
TCP_DEFER_ACCEPT 9
TCP_FASTOPEN 23
TCP_INFO 11
TCP_KEEPCNT 6
TCP_KEEPIDLE 4
TCP_KEEPINTVL 5
TCP_LINGER2 8
TCP_MAXSEG 2
TCP_NODELAY 1
TCP_NOTSENT_LOWAT 25
TCP_QUICKACK 12
TCP_SYNCNT 7
TCP_USER_TIMEOUT 18
TCP_WINDOW_CLAMP 10
TIPC_ADDR_ID 3
TIPC_ADDR_NAME 2
TIPC_ADDR_NAMESEQ 1
TIPC_CFG_SRV 0
TIPC_CLUSTER_SCOPE 2
TIPC_CONN_TIMEOUT 130
TIPC_CRITICAL_IMPORTANCE 3
TIPC_DEST_DROPPABLE 129
TIPC_HIGH_IMPORTANCE 2
TIPC_IMPORTANCE 127
TIPC_LOW_IMPORTANCE 0
TIPC_MEDIUM_IMPORTANCE 1
TIPC_NODE_SCOPE 3
TIPC_PUBLISHED 1
TIPC_SRC_DROPPABLE 128
TIPC_SUB_CANCEL 4
TIPC_SUB_PORTS 1
TIPC_SUB_SERVICE 2
TIPC_SUBSCR_TIMEOUT 3
TIPC_TOP_SRV 1
TIPC_WAIT_FOREVER -1
TIPC_WITHDRAWN 2
TIPC_ZONE_SCOPE 1
UDPLITE_RECV_CSCOV 11
UDPLITE_SEND_CSCOV 10
VM_SOCKETS_INVALID_VERSION 4294967295
VMADDR_CID_ANY 4294967295
VMADDR_CID_HOST 2
VMADDR_PORT_ANY 4294967295

Liste des alias du module socket

Nom de l'alias Définition ciblée
SocketType socket
error OSError
timeout TimeoutError