{
    "mode": "pydoc",
    "parameter": "socket",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/socket/json",
    "generated": "2026-06-02T15:00:38Z",
    "sections": {
        "NAME": {
            "content": "socket\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/socket.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module provides socket operations and some related functions.\nOn Unix, it supports IP (Internet Protocol) and Unix domain sockets.\nOn other systems, it only supports IP. Functions specific for a\nsocket are available as methods of the socket object.\n\nFunctions:\n",
            "subsections": [
                {
                    "name": "socket",
                    "content": ""
                },
                {
                    "name": "socketpair",
                    "content": ""
                },
                {
                    "name": "fromfd",
                    "content": ""
                },
                {
                    "name": "send_fds",
                    "content": ""
                },
                {
                    "name": "recv_fds",
                    "content": ""
                },
                {
                    "name": "fromshare",
                    "content": ""
                },
                {
                    "name": "gethostname",
                    "content": ""
                },
                {
                    "name": "gethostbyname",
                    "content": ""
                },
                {
                    "name": "gethostbyaddr",
                    "content": ""
                },
                {
                    "name": "getservbyname",
                    "content": ""
                },
                {
                    "name": "getprotobyname",
                    "content": ""
                },
                {
                    "name": "ntohs",
                    "content": ""
                },
                {
                    "name": "htons",
                    "content": ""
                },
                {
                    "name": "inet_aton",
                    "content": ""
                },
                {
                    "name": "inet_ntoa",
                    "content": "socket.getdefaulttimeout() -- get the default timeout value\nsocket.setdefaulttimeout() -- set the default timeout value"
                },
                {
                    "name": "create_connection",
                    "content": "optional source address.\n\n[*] not available on all platforms!\n\nSpecial objects:\n\nSocketType -- type object for socket objects\nerror -- exception raised for I/O errors\nhasipv6 -- boolean value indicating if IPv6 is supported\n\nIntEnum constants:\n\nAFINET, AFUNIX -- socket domains (first argument to socket() call)\nSOCKSTREAM, SOCKDGRAM, SOCKRAW -- socket types (second argument)\n\nInteger constants:\n\nMany other constants may be defined; these may be used in calls to\nthe setsockopt() and getsockopt() methods.\n"
                }
            ]
        },
        "CLASSES": {
            "content": "builtins.Exception(builtins.BaseException)\nbuiltins.OSError\nbuiltins.TimeoutError\ngaierror\nherror\nbuiltins.object\nsocket.socket\nsocket\nenum.IntEnum(builtins.int, enum.Enum)\nAddressFamily\nSocketKind\n",
            "subsections": [
                {
                    "name": "class AddressFamily",
                    "content": "|  AddressFamily(value, names=None, *, module=None, qualname=None, type=None, start=1)\n|\n|  An enumeration.\n|\n|  Method resolution order:\n|      AddressFamily\n|      enum.IntEnum\n|      builtins.int\n|      enum.Enum\n|      builtins.object\n|\n|  Data and other attributes defined here:\n|\n|  AFALG = <AddressFamily.AFALG: 38>\n|\n|  AFAPPLETALK = <AddressFamily.AFAPPLETALK: 5>\n|\n|  AFASH = <AddressFamily.AFASH: 18>\n|\n|  AFATMPVC = <AddressFamily.AFATMPVC: 8>\n|\n|  AFATMSVC = <AddressFamily.AFATMSVC: 20>\n|\n|  AFAX25 = <AddressFamily.AFAX25: 3>\n|\n|  AFBLUETOOTH = <AddressFamily.AFBLUETOOTH: 31>\n|\n|  AFBRIDGE = <AddressFamily.AFBRIDGE: 7>\n|\n|  AFCAN = <AddressFamily.AFCAN: 29>\n|\n|  AFECONET = <AddressFamily.AFECONET: 19>\n|\n|  AFINET = <AddressFamily.AFINET: 2>\n|\n|  AFINET6 = <AddressFamily.AFINET6: 10>\n|\n|  AFIPX = <AddressFamily.AFIPX: 4>\n|\n|  AFIRDA = <AddressFamily.AFIRDA: 23>\n|\n|  AFKEY = <AddressFamily.AFKEY: 15>\n|\n|  AFLLC = <AddressFamily.AFLLC: 26>\n|\n|  AFNETBEUI = <AddressFamily.AFNETBEUI: 13>\n|\n|  AFNETLINK = <AddressFamily.AFNETLINK: 16>\n|\n|  AFNETROM = <AddressFamily.AFNETROM: 6>\n|\n|  AFPACKET = <AddressFamily.AFPACKET: 17>\n|\n|  AFPPPOX = <AddressFamily.AFPPPOX: 24>\n|\n|  AFQIPCRTR = <AddressFamily.AFQIPCRTR: 42>\n|\n|  AFRDS = <AddressFamily.AFRDS: 21>\n|\n|  AFROSE = <AddressFamily.AFROSE: 11>\n|\n|  AFSECURITY = <AddressFamily.AFSECURITY: 14>\n|\n|  AFSNA = <AddressFamily.AFSNA: 22>\n|\n|  AFTIPC = <AddressFamily.AFTIPC: 30>\n|\n|  AFUNIX = <AddressFamily.AFUNIX: 1>\n|\n|  AFUNSPEC = <AddressFamily.AFUNSPEC: 0>\n|\n|  AFVSOCK = <AddressFamily.AFVSOCK: 40>\n|\n|  AFWANPIPE = <AddressFamily.AFWANPIPE: 25>\n|\n|  AFX25 = <AddressFamily.AFX25: 9>\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from enum.Enum:\n|\n|  name\n|      The name of the Enum member.\n|\n|  value\n|      The value of the Enum member.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties inherited from enum.EnumMeta:\n|\n|  members\n|      Returns a mapping of member name->value.\n|\n|      This mapping lists all enum members, including aliases. Note that this\n|      is a read-only view of the internal mapping.\n"
                },
                {
                    "name": "class SocketKind",
                    "content": "|  SocketKind(value, names=None, *, module=None, qualname=None, type=None, start=1)\n|\n|  An enumeration.\n|\n|  Method resolution order:\n|      SocketKind\n|      enum.IntEnum\n|      builtins.int\n|      enum.Enum\n|      builtins.object\n|\n|  Data and other attributes defined here:\n|\n|  SOCKCLOEXEC = <SocketKind.SOCKCLOEXEC: 524288>\n|\n|  SOCKDGRAM = <SocketKind.SOCKDGRAM: 2>\n|\n|  SOCKNONBLOCK = <SocketKind.SOCKNONBLOCK: 2048>\n|\n|  SOCKRAW = <SocketKind.SOCKRAW: 3>\n|\n|  SOCKRDM = <SocketKind.SOCKRDM: 4>\n|\n|  SOCKSEQPACKET = <SocketKind.SOCKSEQPACKET: 5>\n|\n|  SOCKSTREAM = <SocketKind.SOCKSTREAM: 1>\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from enum.Enum:\n|\n|  name\n|      The name of the Enum member.\n|\n|  value\n|      The value of the Enum member.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties inherited from enum.EnumMeta:\n|\n|  members\n|      Returns a mapping of member name->value.\n|\n|      This mapping lists all enum members, including aliases. Note that this\n|      is a read-only view of the internal mapping.\n\nSocketType = class socket(builtins.object)\n|  socket(family=AFINET, type=SOCKSTREAM, proto=0) -> socket object\n|  socket(family=-1, type=-1, proto=-1, fileno=None) -> socket object\n|\n|  Open a socket of the given type.  The family argument specifies the\n|  address family; it defaults to AFINET.  The type argument specifies\n|  whether this is a stream (SOCKSTREAM, this is the default)\n|  or datagram (SOCKDGRAM) socket.  The protocol argument defaults to 0,\n|  specifying the default protocol.  Keyword arguments are accepted.\n|  The socket is created as non-inheritable.\n|\n|  When a fileno is passed in, family, type and proto are auto-detected,\n|  unless they are explicitly set.\n|\n|  A socket object represents one endpoint of a network connection.\n|\n|  Methods of socket objects (keyword arguments not allowed):\n|\n|  accept() -- accept connection, returning new socket fd and client address\n|  bind(addr) -- bind the socket to a local address\n|  close() -- close the socket\n|  connect(addr) -- connect the socket to a remote address\n|  connectex(addr) -- connect, return an error code instead of an exception\n|  dup() -- return a new socket fd duplicated from fileno()\n|  fileno() -- return underlying file descriptor\n|  getpeername() -- return remote address [*]\n|  getsockname() -- return local address\n|  getsockopt(level, optname[, buflen]) -- get socket options\n|  gettimeout() -- return timeout or None\n|  listen([n]) -- start listening for incoming connections\n|  recv(buflen[, flags]) -- receive data\n|  recvinto(buffer[, nbytes[, flags]]) -- receive data (into a buffer)\n|  recvfrom(buflen[, flags]) -- receive data and sender's address\n|  recvfrominto(buffer[, nbytes, [, flags])\n|    -- receive data and sender's address (into a buffer)\n|  sendall(data[, flags]) -- send all data\n|  send(data[, flags]) -- send data, may not send all of it\n|  sendto(data[, flags], addr) -- send data to a given address\n|  setblocking(bool) -- set or clear the blocking I/O flag\n|  getblocking() -- return True if socket is blocking, False if non-blocking\n|  setsockopt(level, optname, value[, optlen]) -- set socket options\n|  settimeout(None | float) -- set or clear the timeout\n|  shutdown(how) -- shut down traffic in one or both directions\n|\n|   [*] not available on all platforms!\n|\n|  Methods defined here:\n|\n|  del(...)\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  bind(...)\n|      bind(address)\n|\n|      Bind the socket to a local address.  For IP sockets, the address is a\n|      pair (host, port); the host must refer to the local host. For raw packet\n|      sockets the address is a tuple (ifname, proto [,pkttype [,hatype [,addr]]])\n|\n|  close(...)\n|      close()\n|\n|      Close the socket.  It cannot be used after this call.\n|\n|  connect(...)\n|      connect(address)\n|\n|      Connect the socket to a remote address.  For IP sockets, the address\n|      is a pair (host, port).\n|\n|  connectex(...)\n|      connectex(address) -> errno\n|\n|      This is like connect(address), but returns an error code (the errno value)\n|      instead of raising an exception when an error occurs.\n|\n|  detach(...)\n|      detach()\n|\n|      Close the socket object without closing the underlying file descriptor.\n|      The object cannot be used after this call, but the file descriptor\n|      can be reused for other purposes.  The file descriptor is returned.\n|\n|  fileno(...)\n|      fileno() -> integer\n|\n|      Return the integer file descriptor of the socket.\n|\n|  getblocking(...)\n|      getblocking()\n|\n|      Returns True if socket is in blocking mode, or False if it\n|      is in non-blocking mode.\n|\n|  getpeername(...)\n|      getpeername() -> address info\n|\n|      Return the address of the remote endpoint.  For IP sockets, the address\n|      info is a pair (hostaddr, port).\n|\n|  getsockname(...)\n|      getsockname() -> address info\n|\n|      Return the address of the local endpoint. The format depends on the\n|      address family. For IPv4 sockets, the address info is a pair\n|      (hostaddr, port).\n|\n|  getsockopt(...)\n|      getsockopt(level, option[, buffersize]) -> value\n|\n|      Get a socket option.  See the Unix manual for level and option.\n|      If a nonzero buffersize argument is given, the return value is a\n|      string of that length; otherwise it is an integer.\n|\n|  gettimeout(...)\n|      gettimeout() -> timeout\n|\n|      Returns the timeout in seconds (float) associated with socket\n|      operations. A timeout of None indicates that timeouts on socket\n|      operations are disabled.\n|\n|  listen(...)\n|      listen([backlog])\n|\n|      Enable a server to accept connections.  If backlog is specified, it must be\n|      at least 0 (if it is lower, it is set to 0); it specifies the number of\n|      unaccepted connections that the system will allow before refusing new\n|      connections. If not specified, a default reasonable value is chosen.\n|\n|  recv(...)\n|      recv(buffersize[, flags]) -> data\n|\n|      Receive up to buffersize bytes from the socket.  For the optional flags\n|      argument, see the Unix manual.  When no data is available, block until\n|      at least one byte is available or until the remote end is closed.  When\n|      the remote end is closed and all data is read, return the empty string.\n|\n|  recvinto(...)\n|      recvinto(buffer, [nbytes[, flags]]) -> nbytesread\n|\n|      A version of recv() that stores its data into a buffer rather than creating\n|      a new string.  Receive up to buffersize bytes from the socket.  If buffersize\n|      is not specified (or 0), receive up to the size available in the given buffer.\n|\n|      See recv() for documentation about the flags.\n|\n|  recvfrom(...)\n|      recvfrom(buffersize[, flags]) -> (data, address info)\n|\n|      Like recv(buffersize, flags) but also return the sender's address info.\n|\n|  recvfrominto(...)\n|      recvfrominto(buffer[, nbytes[, flags]]) -> (nbytes, address info)\n|\n|      Like recvinto(buffer[, nbytes[, flags]]) but also return the sender's address info.\n|\n|  recvmsg(...)\n|      recvmsg(bufsize[, ancbufsize[, flags]]) -> (data, ancdata, msgflags, address)\n|\n|      Receive normal data (up to bufsize bytes) and ancillary data from the\n|      socket.  The ancbufsize argument sets the size in bytes of the\n|      internal buffer used to receive the ancillary data; it defaults to 0,\n|      meaning that no ancillary data will be received.  Appropriate buffer\n|      sizes for ancillary data can be calculated using CMSGSPACE() or\n|      CMSGLEN(), and items which do not fit into the buffer might be\n|      truncated or discarded.  The flags argument defaults to 0 and has the\n|      same meaning as for recv().\n|\n|      The return value is a 4-tuple: (data, ancdata, msgflags, address).\n|      The data item is a bytes object holding the non-ancillary data\n|      received.  The ancdata item is a list of zero or more tuples\n|      (cmsglevel, cmsgtype, cmsgdata) representing the ancillary data\n|      (control messages) received: cmsglevel and cmsgtype are integers\n|      specifying the protocol level and protocol-specific type respectively,\n|      and cmsgdata is a bytes object holding the associated data.  The\n|      msgflags item is the bitwise OR of various flags indicating\n|      conditions on the received message; see your system documentation for\n|      details.  If the receiving socket is unconnected, address is the\n|      address of the sending socket, if available; otherwise, its value is\n|      unspecified.\n|\n|      If recvmsg() raises an exception after the system call returns, it\n|      will first attempt to close any file descriptors received via the\n|      SCMRIGHTS mechanism.\n|\n|  recvmsginto(...)\n|      recvmsginto(buffers[, ancbufsize[, flags]]) -> (nbytes, ancdata, msgflags, address)\n|\n|      Receive normal data and ancillary data from the socket, scattering the\n|      non-ancillary data into a series of buffers.  The buffers argument\n|      must be an iterable of objects that export writable buffers\n|      (e.g. bytearray objects); these will be filled with successive chunks\n|      of the non-ancillary data until it has all been written or there are\n|      no more buffers.  The ancbufsize argument sets the size in bytes of\n|      the internal buffer used to receive the ancillary data; it defaults to\n|      0, meaning that no ancillary data will be received.  Appropriate\n|      buffer sizes for ancillary data can be calculated using CMSGSPACE()\n|      or CMSGLEN(), and items which do not fit into the buffer might be\n|      truncated or discarded.  The flags argument defaults to 0 and has the\n|      same meaning as for recv().\n|\n|      The return value is a 4-tuple: (nbytes, ancdata, msgflags, address).\n|      The nbytes item is the total number of bytes of non-ancillary data\n|      written into the buffers.  The ancdata item is a list of zero or more\n|      tuples (cmsglevel, cmsgtype, cmsgdata) representing the ancillary\n|      data (control messages) received: cmsglevel and cmsgtype are\n|      integers specifying the protocol level and protocol-specific type\n|      respectively, and cmsgdata is a bytes object holding the associated\n|      data.  The msgflags item is the bitwise OR of various flags\n|      indicating conditions on the received message; see your system\n|      documentation for details.  If the receiving socket is unconnected,\n|      address is the address of the sending socket, if available; otherwise,\n|      its value is unspecified.\n|\n|      If recvmsginto() raises an exception after the system call returns,\n|      it will first attempt to close any file descriptors received via the\n|      SCMRIGHTS mechanism.\n|\n|  send(...)\n|      send(data[, flags]) -> count\n|\n|      Send a data string to the socket.  For the optional flags\n|      argument, see the Unix manual.  Return the number of bytes\n|      sent; this may be less than len(data) if the network is busy.\n|\n|  sendall(...)\n|      sendall(data[, flags])\n|\n|      Send a data string to the socket.  For the optional flags\n|      argument, see the Unix manual.  This calls send() repeatedly\n|      until all data is sent.  If an error occurs, it's impossible\n|      to tell how much data has been sent.\n|\n|  sendmsg(...)\n|      sendmsg(buffers[, ancdata[, flags[, address]]]) -> count\n|\n|      Send normal and ancillary data to the socket, gathering the\n|      non-ancillary data from a series of buffers and concatenating it into\n|      a single message.  The buffers argument specifies the non-ancillary\n|      data as an iterable of bytes-like objects (e.g. bytes objects).\n|      The ancdata argument specifies the ancillary data (control messages)\n|      as an iterable of zero or more tuples (cmsglevel, cmsgtype,\n|      cmsgdata), where cmsglevel and cmsgtype are integers specifying the\n|      protocol level and protocol-specific type respectively, and cmsgdata\n|      is a bytes-like object holding the associated data.  The flags\n|      argument defaults to 0 and has the same meaning as for send().  If\n|      address is supplied and not None, it sets a destination address for\n|      the message.  The return value is the number of bytes of non-ancillary\n|      data sent.\n|\n|  sendmsgafalg(...)\n|      sendmsgafalg([msg], *, op[, iv[, assoclen[, flags=MSGMORE]]])\n|\n|      Set operation mode, IV and length of associated data for an AFALG\n|      operation socket.\n|\n|  sendto(...)\n|      sendto(data[, flags], address) -> count\n|\n|      Like send(data, flags) but allows specifying the destination address.\n|      For IP sockets, the address is a pair (hostaddr, port).\n|\n|  setblocking(...)\n|      setblocking(flag)\n|\n|      Set the socket to blocking (flag is true) or non-blocking (false).\n|      setblocking(True) is equivalent to settimeout(None);\n|      setblocking(False) is equivalent to settimeout(0.0).\n|\n|  setsockopt(...)\n|      setsockopt(level, option, value: int)\n|      setsockopt(level, option, value: buffer)\n|      setsockopt(level, option, None, optlen: int)\n|\n|      Set a socket option.  See the Unix manual for level and option.\n|      The value argument can either be an integer, a string buffer, or\n|      None, optlen.\n|\n|  settimeout(...)\n|      settimeout(timeout)\n|\n|      Set a timeout on socket operations.  'timeout' can be a float,\n|      giving in seconds, or None.  Setting a timeout of None disables\n|      the timeout feature and is equivalent to setblocking(1).\n|      Setting a timeout of zero is the same as setblocking(0).\n|\n|  shutdown(...)\n|      shutdown(flag)\n|\n|      Shut down the reading side of the socket (flag == SHUTRD), the writing side\n|      of the socket (flag == SHUTWR), or both ends (flag == SHUTRDWR).\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  family\n|      the socket family\n|\n|  proto\n|      the socket protocol\n|\n|  timeout\n|      the socket timeout\n|\n|  type\n|      the socket type\n\nerror = class OSError(Exception)\n|  Base class for I/O related errors.\n|\n|  Method resolution order:\n|      OSError\n|      Exception\n|      BaseException\n|      object\n|\n|  Built-in subclasses:\n|      BlockingIOError\n|      ChildProcessError\n|      ConnectionError\n|      FileExistsError\n|      ... and 7 other subclasses\n|\n|  Methods defined here:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  characterswritten\n|\n|  errno\n|      POSIX exception code\n|\n|  filename\n|      exception filename\n|\n|  filename2\n|      second exception filename\n|\n|  strerror\n|      exception strerror\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                },
                {
                    "name": "class gaierror",
                    "content": "|  Method resolution order:\n|      gaierror\n|      builtins.OSError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.OSError:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.OSError:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.OSError:\n|\n|  characterswritten\n|\n|  errno\n|      POSIX exception code\n|\n|  filename\n|      exception filename\n|\n|  filename2\n|      second exception filename\n|\n|  strerror\n|      exception strerror\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                },
                {
                    "name": "class herror",
                    "content": "|  Method resolution order:\n|      herror\n|      builtins.OSError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.OSError:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.OSError:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.OSError:\n|\n|  characterswritten\n|\n|  errno\n|      POSIX exception code\n|\n|  filename\n|      exception filename\n|\n|  filename2\n|      second exception filename\n|\n|  strerror\n|      exception strerror\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                },
                {
                    "name": "class socket",
                    "content": "|  socket(family=-1, type=-1, proto=-1, fileno=None)\n|\n|  A subclass of socket.socket adding the makefile() method.\n|\n|  Method resolution order:\n|      socket\n|      socket.socket\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  enter(self)\n|\n|  exit(self, *args)\n|\n|  getstate(self)\n|\n|  init(self, family=-1, type=-1, proto=-1, fileno=None)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  repr(self)\n|      Wrap repr() to reveal the real class name and socket\n|      address(es).\n|\n|  accept(self)\n|      accept() -> (socket object, address info)\n|\n|      Wait for an incoming connection.  Return a new socket\n|      representing the connection, and the address of the client.\n|      For IP sockets, the address info is a pair (hostaddr, port).\n|\n|  close(self)\n|      close()\n|\n|      Close the socket.  It cannot be used after this call.\n|\n|  detach(self)\n|      detach() -> file descriptor\n|\n|      Close the socket object without closing the underlying file descriptor.\n|      The object cannot be used after this call, but the file descriptor\n|      can be reused for other purposes.  The file descriptor is returned.\n|\n|  dup(self)\n|      dup() -> socket object\n|\n|      Duplicate the socket. Return a new socket object connected to the same\n|      system resource. The new socket is non-inheritable.\n|\n|  getinheritable(self)\n|      Get the inheritable flag of the socket\n|\n|  makefile(self, mode='r', buffering=None, *, encoding=None, errors=None, newline=None)\n|      makefile(...) -> an I/O stream connected to the socket\n|\n|      The arguments are as for io.open() after the filename, except the only\n|      supported mode values are 'r' (default), 'w' and 'b'.\n|\n|  sendfile(self, file, offset=0, count=None)\n|      sendfile(file[, offset[, count]]) -> sent\n|\n|      Send a file until EOF is reached by using high-performance\n|      os.sendfile() and return the total number of bytes which\n|      were sent.\n|      *file* must be a regular file object opened in binary mode.\n|      If os.sendfile() is not available (e.g. Windows) or file is\n|      not a regular file socket.send() will be used instead.\n|      *offset* tells from where to start reading the file.\n|      If specified, *count* is the total number of bytes to transmit\n|      as opposed to sending the file until EOF is reached.\n|      File position is updated on return or also in case of error in\n|      which case file.tell() can be used to figure out the number of\n|      bytes which were sent.\n|      The socket must be of SOCKSTREAM type.\n|      Non-blocking sockets are not supported.\n|\n|  setinheritable(self, inheritable)\n|      Set the inheritable flag of the socket\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties defined here:\n|\n|  family\n|      Read-only access to the address family for this socket.\n|\n|  type\n|      Read-only access to the socket type.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from socket.socket:\n|\n|  del(...)\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  bind(...)\n|      bind(address)\n|\n|      Bind the socket to a local address.  For IP sockets, the address is a\n|      pair (host, port); the host must refer to the local host. For raw packet\n|      sockets the address is a tuple (ifname, proto [,pkttype [,hatype [,addr]]])\n|\n|  connect(...)\n|      connect(address)\n|\n|      Connect the socket to a remote address.  For IP sockets, the address\n|      is a pair (host, port).\n|\n|  connectex(...)\n|      connectex(address) -> errno\n|\n|      This is like connect(address), but returns an error code (the errno value)\n|      instead of raising an exception when an error occurs.\n|\n|  fileno(...)\n|      fileno() -> integer\n|\n|      Return the integer file descriptor of the socket.\n|\n|  getblocking(...)\n|      getblocking()\n|\n|      Returns True if socket is in blocking mode, or False if it\n|      is in non-blocking mode.\n|\n|  getpeername(...)\n|      getpeername() -> address info\n|\n|      Return the address of the remote endpoint.  For IP sockets, the address\n|      info is a pair (hostaddr, port).\n|\n|  getsockname(...)\n|      getsockname() -> address info\n|\n|      Return the address of the local endpoint. The format depends on the\n|      address family. For IPv4 sockets, the address info is a pair\n|      (hostaddr, port).\n|\n|  getsockopt(...)\n|      getsockopt(level, option[, buffersize]) -> value\n|\n|      Get a socket option.  See the Unix manual for level and option.\n|      If a nonzero buffersize argument is given, the return value is a\n|      string of that length; otherwise it is an integer.\n|\n|  gettimeout(...)\n|      gettimeout() -> timeout\n|\n|      Returns the timeout in seconds (float) associated with socket\n|      operations. A timeout of None indicates that timeouts on socket\n|      operations are disabled.\n|\n|  listen(...)\n|      listen([backlog])\n|\n|      Enable a server to accept connections.  If backlog is specified, it must be\n|      at least 0 (if it is lower, it is set to 0); it specifies the number of\n|      unaccepted connections that the system will allow before refusing new\n|      connections. If not specified, a default reasonable value is chosen.\n|\n|  recv(...)\n|      recv(buffersize[, flags]) -> data\n|\n|      Receive up to buffersize bytes from the socket.  For the optional flags\n|      argument, see the Unix manual.  When no data is available, block until\n|      at least one byte is available or until the remote end is closed.  When\n|      the remote end is closed and all data is read, return the empty string.\n|\n|  recvinto(...)\n|      recvinto(buffer, [nbytes[, flags]]) -> nbytesread\n|\n|      A version of recv() that stores its data into a buffer rather than creating\n|      a new string.  Receive up to buffersize bytes from the socket.  If buffersize\n|      is not specified (or 0), receive up to the size available in the given buffer.\n|\n|      See recv() for documentation about the flags.\n|\n|  recvfrom(...)\n|      recvfrom(buffersize[, flags]) -> (data, address info)\n|\n|      Like recv(buffersize, flags) but also return the sender's address info.\n|\n|  recvfrominto(...)\n|      recvfrominto(buffer[, nbytes[, flags]]) -> (nbytes, address info)\n|\n|      Like recvinto(buffer[, nbytes[, flags]]) but also return the sender's address info.\n|\n|  recvmsg(...)\n|      recvmsg(bufsize[, ancbufsize[, flags]]) -> (data, ancdata, msgflags, address)\n|\n|      Receive normal data (up to bufsize bytes) and ancillary data from the\n|      socket.  The ancbufsize argument sets the size in bytes of the\n|      internal buffer used to receive the ancillary data; it defaults to 0,\n|      meaning that no ancillary data will be received.  Appropriate buffer\n|      sizes for ancillary data can be calculated using CMSGSPACE() or\n|      CMSGLEN(), and items which do not fit into the buffer might be\n|      truncated or discarded.  The flags argument defaults to 0 and has the\n|      same meaning as for recv().\n|\n|      The return value is a 4-tuple: (data, ancdata, msgflags, address).\n|      The data item is a bytes object holding the non-ancillary data\n|      received.  The ancdata item is a list of zero or more tuples\n|      (cmsglevel, cmsgtype, cmsgdata) representing the ancillary data\n|      (control messages) received: cmsglevel and cmsgtype are integers\n|      specifying the protocol level and protocol-specific type respectively,\n|      and cmsgdata is a bytes object holding the associated data.  The\n|      msgflags item is the bitwise OR of various flags indicating\n|      conditions on the received message; see your system documentation for\n|      details.  If the receiving socket is unconnected, address is the\n|      address of the sending socket, if available; otherwise, its value is\n|      unspecified.\n|\n|      If recvmsg() raises an exception after the system call returns, it\n|      will first attempt to close any file descriptors received via the\n|      SCMRIGHTS mechanism.\n|\n|  recvmsginto(...)\n|      recvmsginto(buffers[, ancbufsize[, flags]]) -> (nbytes, ancdata, msgflags, address)\n|\n|      Receive normal data and ancillary data from the socket, scattering the\n|      non-ancillary data into a series of buffers.  The buffers argument\n|      must be an iterable of objects that export writable buffers\n|      (e.g. bytearray objects); these will be filled with successive chunks\n|      of the non-ancillary data until it has all been written or there are\n|      no more buffers.  The ancbufsize argument sets the size in bytes of\n|      the internal buffer used to receive the ancillary data; it defaults to\n|      0, meaning that no ancillary data will be received.  Appropriate\n|      buffer sizes for ancillary data can be calculated using CMSGSPACE()\n|      or CMSGLEN(), and items which do not fit into the buffer might be\n|      truncated or discarded.  The flags argument defaults to 0 and has the\n|      same meaning as for recv().\n|\n|      The return value is a 4-tuple: (nbytes, ancdata, msgflags, address).\n|      The nbytes item is the total number of bytes of non-ancillary data\n|      written into the buffers.  The ancdata item is a list of zero or more\n|      tuples (cmsglevel, cmsgtype, cmsgdata) representing the ancillary\n|      data (control messages) received: cmsglevel and cmsgtype are\n|      integers specifying the protocol level and protocol-specific type\n|      respectively, and cmsgdata is a bytes object holding the associated\n|      data.  The msgflags item is the bitwise OR of various flags\n|      indicating conditions on the received message; see your system\n|      documentation for details.  If the receiving socket is unconnected,\n|      address is the address of the sending socket, if available; otherwise,\n|      its value is unspecified.\n|\n|      If recvmsginto() raises an exception after the system call returns,\n|      it will first attempt to close any file descriptors received via the\n|      SCMRIGHTS mechanism.\n|\n|  send(...)\n|      send(data[, flags]) -> count\n|\n|      Send a data string to the socket.  For the optional flags\n|      argument, see the Unix manual.  Return the number of bytes\n|      sent; this may be less than len(data) if the network is busy.\n|\n|  sendall(...)\n|      sendall(data[, flags])\n|\n|      Send a data string to the socket.  For the optional flags\n|      argument, see the Unix manual.  This calls send() repeatedly\n|      until all data is sent.  If an error occurs, it's impossible\n|      to tell how much data has been sent.\n|\n|  sendmsg(...)\n|      sendmsg(buffers[, ancdata[, flags[, address]]]) -> count\n|\n|      Send normal and ancillary data to the socket, gathering the\n|      non-ancillary data from a series of buffers and concatenating it into\n|      a single message.  The buffers argument specifies the non-ancillary\n|      data as an iterable of bytes-like objects (e.g. bytes objects).\n|      The ancdata argument specifies the ancillary data (control messages)\n|      as an iterable of zero or more tuples (cmsglevel, cmsgtype,\n|      cmsgdata), where cmsglevel and cmsgtype are integers specifying the\n|      protocol level and protocol-specific type respectively, and cmsgdata\n|      is a bytes-like object holding the associated data.  The flags\n|      argument defaults to 0 and has the same meaning as for send().  If\n|      address is supplied and not None, it sets a destination address for\n|      the message.  The return value is the number of bytes of non-ancillary\n|      data sent.\n|\n|  sendmsgafalg(...)\n|      sendmsgafalg([msg], *, op[, iv[, assoclen[, flags=MSGMORE]]])\n|\n|      Set operation mode, IV and length of associated data for an AFALG\n|      operation socket.\n|\n|  sendto(...)\n|      sendto(data[, flags], address) -> count\n|\n|      Like send(data, flags) but allows specifying the destination address.\n|      For IP sockets, the address is a pair (hostaddr, port).\n|\n|  setblocking(...)\n|      setblocking(flag)\n|\n|      Set the socket to blocking (flag is true) or non-blocking (false).\n|      setblocking(True) is equivalent to settimeout(None);\n|      setblocking(False) is equivalent to settimeout(0.0).\n|\n|  setsockopt(...)\n|      setsockopt(level, option, value: int)\n|      setsockopt(level, option, value: buffer)\n|      setsockopt(level, option, None, optlen: int)\n|\n|      Set a socket option.  See the Unix manual for level and option.\n|      The value argument can either be an integer, a string buffer, or\n|      None, optlen.\n|\n|  settimeout(...)\n|      settimeout(timeout)\n|\n|      Set a timeout on socket operations.  'timeout' can be a float,\n|      giving in seconds, or None.  Setting a timeout of None disables\n|      the timeout feature and is equivalent to setblocking(1).\n|      Setting a timeout of zero is the same as setblocking(0).\n|\n|  shutdown(...)\n|      shutdown(flag)\n|\n|      Shut down the reading side of the socket (flag == SHUTRD), the writing side\n|      of the socket (flag == SHUTWR), or both ends (flag == SHUTRDWR).\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from socket.socket:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from socket.socket:\n|\n|  proto\n|      the socket protocol\n|\n|  timeout\n|      the socket timeout\n\ntimeout = class TimeoutError(OSError)\n|  Timeout expired.\n|\n|  Method resolution order:\n|      TimeoutError\n|      OSError\n|      Exception\n|      BaseException\n|      object\n|\n|  Methods defined here:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from OSError:\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from OSError:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from OSError:\n|\n|  characterswritten\n|\n|  errno\n|      POSIX exception code\n|\n|  filename\n|      exception filename\n|\n|  filename2\n|      second exception filename\n|\n|  strerror\n|      exception strerror\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                }
            ]
        },
        "FUNCTIONS": {
            "content": "CMSGLEN(...)\nCMSGLEN(length) -> control message length\n\nReturn the total length, without trailing padding, of an ancillary\ndata item with associated data of the given length.  This value can\noften be used as the buffer size for recvmsg() to receive a single\nitem of ancillary data, but RFC 3542 requires portable applications to\nuse CMSGSPACE() and thus include space for padding, even when the\nitem will be the last in the buffer.  Raises OverflowError if length\nis outside the permissible range of values.\n\nCMSGSPACE(...)\nCMSGSPACE(length) -> buffer size\n\nReturn the buffer size needed for recvmsg() to receive an ancillary\ndata item with associated data of the given length, along with any\ntrailing padding.  The buffer space needed to receive multiple items\nis the sum of the CMSGSPACE() values for their associated data\nlengths.  Raises OverflowError if length is outside the permissible\nrange of values.\n",
            "subsections": [
                {
                    "name": "close",
                    "content": "close(integer) -> None\n\nClose an integer socket file descriptor.  This is like os.close(), but for\nsockets; on some platforms os.close() won't work for socket file descriptors.\n"
                },
                {
                    "name": "create_connection",
                    "content": "Connect to *address* and return the socket object.\n\nConvenience function.  Connect to *address* (a 2-tuple ``(host,\nport)``) and return the socket object.  Passing the optional\n*timeout* parameter will set the timeout on the socket instance\nbefore attempting to connect.  If no *timeout* is supplied, the\nglobal default timeout setting returned by :func:`getdefaulttimeout`\nis used.  If *sourceaddress* is set it must be a tuple of (host, port)\nfor the socket to bind as a source address before making the connection.\nA host of '' or port 0 tells the OS to use the default.\n"
                },
                {
                    "name": "create_server",
                    "content": "Convenience function which creates a SOCKSTREAM type socket\nbound to *address* (a 2-tuple (host, port)) and return the socket\nobject.\n\n*family* should be either AFINET or AFINET6.\n*backlog* is the queue size passed to socket.listen().\n*reuseport* dictates whether to use the SOREUSEPORT socket option.\n*dualstackipv6*: if true and the platform supports it, it will\ncreate an AFINET6 socket able to accept both IPv4 or IPv6\nconnections. When false it will explicitly disable this option on\nplatforms that enable it by default (e.g. Linux).\n\n>>> with createserver(('', 8000)) as server:\n...     while True:\n...         conn, addr = server.accept()\n...         # handle new connection\n"
                },
                {
                    "name": "dup",
                    "content": "dup(integer) -> integer\n\nDuplicate an integer socket file descriptor.  This is like os.dup(), but for\nsockets; on some platforms os.dup() won't work for socket file descriptors.\n"
                },
                {
                    "name": "fromfd",
                    "content": "fromfd(fd, family, type[, proto]) -> socket object\n\nCreate a socket object from a duplicate of the given file\ndescriptor.  The remaining arguments are the same as for socket().\n"
                },
                {
                    "name": "getaddrinfo",
                    "content": "Resolve host and port into list of address info entries.\n\nTranslate the host/port argument into a sequence of 5-tuples that contain\nall the necessary arguments for creating a socket connected to that service.\nhost is a domain name, a string representation of an IPv4/v6 address or\nNone. port is a string service name such as 'http', a numeric port number or\nNone. By passing None as the value of host and port, you can pass NULL to\nthe underlying C API.\n\nThe family, type and proto arguments can be optionally specified in order to\nnarrow the list of addresses returned. Passing zero as a value for each of\nthese arguments selects the full range of results.\n"
                },
                {
                    "name": "getdefaulttimeout",
                    "content": "getdefaulttimeout() -> timeout\n\nReturns the default timeout in seconds (float) for new socket objects.\nA value of None indicates that new socket objects have no timeout.\nWhen the socket module is first imported, the default is None.\n"
                },
                {
                    "name": "getfqdn",
                    "content": "Get fully qualified domain name from name.\n\nAn empty argument is interpreted as meaning the local host.\n\nFirst the hostname returned by gethostbyaddr() is checked, then\npossibly existing aliases. In case no FQDN is available and `name`\nwas given, it is returned unchanged. If `name` was empty, '0.0.0.0' or '::',\nhostname from gethostname() is returned.\n"
                },
                {
                    "name": "gethostbyaddr",
                    "content": "gethostbyaddr(host) -> (name, aliaslist, addresslist)\n\nReturn the true host name, a list of aliases, and a list of IP addresses,\nfor a host.  The host argument is a string giving a host name or IP number.\n"
                },
                {
                    "name": "gethostbyname",
                    "content": "gethostbyname(host) -> address\n\nReturn the IP address (a string of the form '255.255.255.255') for a host.\n"
                },
                {
                    "name": "gethostbyname_ex",
                    "content": "gethostbynameex(host) -> (name, aliaslist, addresslist)\n\nReturn the true host name, a list of aliases, and a list of IP addresses,\nfor a host.  The host argument is a string giving a host name or IP number.\n"
                },
                {
                    "name": "gethostname",
                    "content": "gethostname() -> string\n\nReturn the current host name.\n"
                },
                {
                    "name": "getnameinfo",
                    "content": "getnameinfo(sockaddr, flags) --> (host, port)\n\nGet host and port for a sockaddr.\n"
                },
                {
                    "name": "getprotobyname",
                    "content": "getprotobyname(name) -> integer\n\nReturn the protocol number for the named protocol.  (Rarely used.)\n"
                },
                {
                    "name": "getservbyname",
                    "content": "getservbyname(servicename[, protocolname]) -> integer\n\nReturn a port number from a service name and protocol name.\nThe optional protocol name, if given, should be 'tcp' or 'udp',\notherwise any protocol will match.\n"
                },
                {
                    "name": "getservbyport",
                    "content": "getservbyport(port[, protocolname]) -> string\n\nReturn the service name from a port number and protocol name.\nThe optional protocol name, if given, should be 'tcp' or 'udp',\notherwise any protocol will match.\n"
                },
                {
                    "name": "has_dualstack_ipv6",
                    "content": "Return True if the platform supports creating a SOCKSTREAM socket\nwhich can handle both AFINET and AFINET6 (IPv4 / IPv6) connections.\n"
                },
                {
                    "name": "htonl",
                    "content": "htonl(integer) -> integer\n\nConvert a 32-bit integer from host to network byte order.\n"
                },
                {
                    "name": "htons",
                    "content": "htons(integer) -> integer\n\nConvert a 16-bit unsigned integer from host to network byte order.\n"
                },
                {
                    "name": "if_indextoname",
                    "content": "ifindextoname(ifindex)\n\nReturns the interface name corresponding to the interface index ifindex.\n"
                },
                {
                    "name": "if_nameindex",
                    "content": "ifnameindex()\n\nReturns a list of network interface information (index, name) tuples.\n"
                },
                {
                    "name": "if_nametoindex",
                    "content": "ifnametoindex(ifname)\n\nReturns the interface index corresponding to the interface name ifname.\n"
                },
                {
                    "name": "inet_aton",
                    "content": "inetaton(string) -> bytes giving packed 32-bit IP representation\n\nConvert an IP address in string format (123.45.67.89) to the 32-bit packed\nbinary format used in low-level network functions.\n"
                },
                {
                    "name": "inet_ntoa",
                    "content": "inetntoa(packedip) -> ipaddressstring\n\nConvert an IP address from 32-bit packed binary format to string format\n"
                },
                {
                    "name": "inet_ntop",
                    "content": "inetntop(af, packedip) -> string formatted IP address\n\nConvert a packed IP address of the given family to string format.\n"
                },
                {
                    "name": "inet_pton",
                    "content": "inetpton(af, ip) -> packed IP address string\n\nConvert an IP address from string format to a packed string suitable\nfor use with low-level network functions.\n"
                },
                {
                    "name": "ntohl",
                    "content": "ntohl(integer) -> integer\n\nConvert a 32-bit integer from network to host byte order.\n"
                },
                {
                    "name": "ntohs",
                    "content": "ntohs(integer) -> integer\n\nConvert a 16-bit unsigned integer from network to host byte order.\n"
                },
                {
                    "name": "recv_fds",
                    "content": "recvfds(sock, bufsize, maxfds[, flags]) -> (data, list of file\ndescriptors, msgflags, address)\n\nReceive up to maxfds file descriptors returning the message\ndata and a list containing the descriptors.\n"
                },
                {
                    "name": "send_fds",
                    "content": "sendfds(sock, buffers, fds[, flags[, address]]) -> integer\n\nSend the list of file descriptors fds over an AFUNIX socket.\n"
                },
                {
                    "name": "setdefaulttimeout",
                    "content": "setdefaulttimeout(timeout)\n\nSet the default timeout in seconds (float) for new socket objects.\nA value of None indicates that new socket objects have no timeout.\nWhen the socket module is first imported, the default is None.\n"
                },
                {
                    "name": "sethostname",
                    "content": "sethostname(name)\n\nSets the hostname to name.\n"
                },
                {
                    "name": "socketpair",
                    "content": "socketpair([family[, type[, proto]]]) -> (socket object, socket object)\nCreate a pair of socket objects from the sockets returned by the platform\nsocketpair() function.\nThe arguments are the same as for socket() except the default family is AFUNIX\nif defined on the platform; otherwise, the default is AFINET.\n"
                }
            ]
        },
        "DATA": {
            "content": "AFALG = <AddressFamily.AFALG: 38>\nAFAPPLETALK = <AddressFamily.AFAPPLETALK: 5>\nAFASH = <AddressFamily.AFASH: 18>\nAFATMPVC = <AddressFamily.AFATMPVC: 8>\nAFATMSVC = <AddressFamily.AFATMSVC: 20>\nAFAX25 = <AddressFamily.AFAX25: 3>\nAFBLUETOOTH = <AddressFamily.AFBLUETOOTH: 31>\nAFBRIDGE = <AddressFamily.AFBRIDGE: 7>\nAFCAN = <AddressFamily.AFCAN: 29>\nAFDECnet = 12\nAFECONET = <AddressFamily.AFECONET: 19>\nAFINET = <AddressFamily.AFINET: 2>\nAFINET6 = <AddressFamily.AFINET6: 10>\nAFIPX = <AddressFamily.AFIPX: 4>\nAFIRDA = <AddressFamily.AFIRDA: 23>\nAFKEY = <AddressFamily.AFKEY: 15>\nAFLLC = <AddressFamily.AFLLC: 26>\nAFNETBEUI = <AddressFamily.AFNETBEUI: 13>\nAFNETLINK = <AddressFamily.AFNETLINK: 16>\nAFNETROM = <AddressFamily.AFNETROM: 6>\nAFPACKET = <AddressFamily.AFPACKET: 17>\nAFPPPOX = <AddressFamily.AFPPPOX: 24>\nAFQIPCRTR = <AddressFamily.AFQIPCRTR: 42>\nAFRDS = <AddressFamily.AFRDS: 21>\nAFROSE = <AddressFamily.AFROSE: 11>\nAFROUTE = <AddressFamily.AFNETLINK: 16>\nAFSECURITY = <AddressFamily.AFSECURITY: 14>\nAFSNA = <AddressFamily.AFSNA: 22>\nAFTIPC = <AddressFamily.AFTIPC: 30>\nAFUNIX = <AddressFamily.AFUNIX: 1>\nAFUNSPEC = <AddressFamily.AFUNSPEC: 0>\nAFVSOCK = <AddressFamily.AFVSOCK: 40>\nAFWANPIPE = <AddressFamily.AFWANPIPE: 25>\nAFX25 = <AddressFamily.AFX25: 9>\nAIADDRCONFIG = <AddressInfo.AIADDRCONFIG: 32>\nAIALL = <AddressInfo.AIALL: 16>\nAICANONNAME = <AddressInfo.AICANONNAME: 2>\nAINUMERICHOST = <AddressInfo.AINUMERICHOST: 4>\nAINUMERICSERV = <AddressInfo.AINUMERICSERV: 1024>\nAIPASSIVE = <AddressInfo.AIPASSIVE: 1>\nAIV4MAPPED = <AddressInfo.AIV4MAPPED: 8>\nALGOPDECRYPT = 0\nALGOPENCRYPT = 1\nALGOPSIGN = 2\nALGOPVERIFY = 3\nALGSETAEADASSOCLEN = 4\nALGSETAEADAUTHSIZE = 5\nALGSETIV = 2\nALGSETKEY = 1\nALGSETOP = 3\nALGSETPUBKEY = 6\nBDADDRANY = '00:00:00:00:00:00'\nBDADDRLOCAL = '00:00:00:FF:FF:FF'\nBTPROTOHCI = 1\nBTPROTOL2CAP = 0\nBTPROTORFCOMM = 3\nBTPROTOSCO = 2\nCANBCM = 2\nCANBCMCANFDFRAME = 2048\nCANBCMRXANNOUNCERESUME = 256\nCANBCMRXCHANGED = 12\nCANBCMRXCHECKDLC = 64\nCANBCMRXDELETE = 6\nCANBCMRXFILTERID = 32\nCANBCMRXNOAUTOTIMER = 128\nCANBCMRXREAD = 7\nCANBCMRXRTRFRAME = 1024\nCANBCMRXSETUP = 5\nCANBCMRXSTATUS = 10\nCANBCMRXTIMEOUT = 11\nCANBCMSETTIMER = 1\nCANBCMSTARTTIMER = 2\nCANBCMTXANNOUNCE = 8\nCANBCMTXCOUNTEVT = 4\nCANBCMTXCPCANID = 16\nCANBCMTXDELETE = 2\nCANBCMTXEXPIRED = 9\nCANBCMTXREAD = 3\nCANBCMTXRESETMULTIIDX = 512\nCANBCMTXSEND = 4\nCANBCMTXSETUP = 1\nCANBCMTXSTATUS = 8\nCANEFFFLAG = 2147483648\nCANEFFMASK = 536870911\nCANERRFLAG = 536870912\nCANERRMASK = 536870911\nCANISOTP = 6\nCANJ1939 = 7\nCANRAW = 1\nCANRAWERRFILTER = 2\nCANRAWFDFRAMES = 5\nCANRAWFILTER = 1\nCANRAWJOINFILTERS = 6\nCANRAWLOOPBACK = 3\nCANRAWRECVOWNMSGS = 4\nCANRTRFLAG = 1073741824\nCANSFFMASK = 2047\nCAPI = <capsule object \"socket.CAPI\">\nEAIADDRFAMILY = -9\nEAIAGAIN = -3\nEAIBADFLAGS = -1\nEAIFAIL = -4\nEAIFAMILY = -6\nEAIMEMORY = -10\nEAINODATA = -5\nEAINONAME = -2\nEAIOVERFLOW = -12\nEAISERVICE = -8\nEAISOCKTYPE = -7\nEAISYSTEM = -11\nHCIDATADIR = 1\nHCIFILTER = 2\nHCITIMESTAMP = 3\nINADDRALLHOSTSGROUP = 3758096385\nINADDRANY = 0\nINADDRBROADCAST = 4294967295\nINADDRLOOPBACK = 2130706433\nINADDRMAXLOCALGROUP = 3758096639\nINADDRNONE = 4294967295\nINADDRUNSPECGROUP = 3758096384\nIOCTLVMSOCKETSGETLOCALCID = 1977\nIPPORTRESERVED = 1024\nIPPORTUSERRESERVED = 5000\nIPPROTOAH = 51\nIPPROTODSTOPTS = 60\nIPPROTOEGP = 8\nIPPROTOESP = 50\nIPPROTOFRAGMENT = 44\nIPPROTOGRE = 47\nIPPROTOHOPOPTS = 0\nIPPROTOICMP = 1\nIPPROTOICMPV6 = 58\nIPPROTOIDP = 22\nIPPROTOIGMP = 2\nIPPROTOIP = 0\nIPPROTOIPIP = 4\nIPPROTOIPV6 = 41\nIPPROTOMPTCP = 262\nIPPROTONONE = 59\nIPPROTOPIM = 103\nIPPROTOPUP = 12\nIPPROTORAW = 255\nIPPROTOROUTING = 43\nIPPROTORSVP = 46\nIPPROTOSCTP = 132\nIPPROTOTCP = 6\nIPPROTOTP = 29\nIPPROTOUDP = 17\nIPPROTOUDPLITE = 136\nIPV6CHECKSUM = 7\nIPV6DONTFRAG = 62\nIPV6DSTOPTS = 59\nIPV6HOPLIMIT = 52\nIPV6HOPOPTS = 54\nIPV6JOINGROUP = 20\nIPV6LEAVEGROUP = 21\nIPV6MULTICASTHOPS = 18\nIPV6MULTICASTIF = 17\nIPV6MULTICASTLOOP = 19\nIPV6NEXTHOP = 9\nIPV6PATHMTU = 61\nIPV6PKTINFO = 50\nIPV6RECVDSTOPTS = 58\nIPV6RECVHOPLIMIT = 51\nIPV6RECVHOPOPTS = 53\nIPV6RECVPATHMTU = 60\nIPV6RECVPKTINFO = 49\nIPV6RECVRTHDR = 56\nIPV6RECVTCLASS = 66\nIPV6RTHDR = 57\nIPV6RTHDRDSTOPTS = 55\nIPV6RTHDRTYPE0 = 0\nIPV6TCLASS = 67\nIPV6UNICASTHOPS = 16\nIPV6V6ONLY = 26\nIPADDMEMBERSHIP = 35\nIPDEFAULTMULTICASTLOOP = 1\nIPDEFAULTMULTICASTTTL = 1\nIPDROPMEMBERSHIP = 36\nIPHDRINCL = 3\nIPMAXMEMBERSHIPS = 20\nIPMULTICASTIF = 32\nIPMULTICASTLOOP = 34\nIPMULTICASTTTL = 33\nIPOPTIONS = 4\nIPRECVOPTS = 6\nIPRECVRETOPTS = 7\nIPRECVTOS = 13\nIPRETOPTS = 7\nIPTOS = 1\nIPTRANSPARENT = 19\nIPTTL = 2\nJ1939EEINFONONE = 0\nJ1939EEINFOTXABORT = 1\nJ1939FILTERMAX = 512\nJ1939IDLEADDR = 254\nJ1939MAXUNICASTADDR = 253\nJ1939NLABYTESACKED = 1\nJ1939NLAPAD = 0\nJ1939NOADDR = 255\nJ1939NONAME = 0\nJ1939NOPGN = 262144\nJ1939PGNADDRESSCLAIMED = 60928\nJ1939PGNADDRESSCOMMANDED = 65240\nJ1939PGNMAX = 262143\nJ1939PGNPDU1MAX = 261888\nJ1939PGNREQUEST = 59904\nMSGCMSGCLOEXEC = <MsgFlag.MSGCMSGCLOEXEC: 1073741824>\nMSGCONFIRM = <MsgFlag.MSGCONFIRM: 2048>\nMSGCTRUNC = <MsgFlag.MSGCTRUNC: 8>\nMSGDONTROUTE = <MsgFlag.MSGDONTROUTE: 4>\nMSGDONTWAIT = <MsgFlag.MSGDONTWAIT: 64>\nMSGEOR = <MsgFlag.MSGEOR: 128>\nMSGERRQUEUE = <MsgFlag.MSGERRQUEUE: 8192>\nMSGFASTOPEN = <MsgFlag.MSGFASTOPEN: 536870912>\nMSGMORE = <MsgFlag.MSGMORE: 32768>\nMSGNOSIGNAL = <MsgFlag.MSGNOSIGNAL: 16384>\nMSGOOB = <MsgFlag.MSGOOB: 1>\nMSGPEEK = <MsgFlag.MSGPEEK: 2>\nMSGTRUNC = <MsgFlag.MSGTRUNC: 32>\nMSGWAITALL = <MsgFlag.MSGWAITALL: 256>\nNETLINKCRYPTO = 21\nNETLINKDNRTMSG = 14\nNETLINKFIREWALL = 3\nNETLINKIP6FW = 13\nNETLINKNFLOG = 5\nNETLINKROUTE = 0\nNETLINKUSERSOCK = 2\nNETLINKXFRM = 6\nNIDGRAM = 16\nNIMAXHOST = 1025\nNIMAXSERV = 32\nNINAMEREQD = 8\nNINOFQDN = 4\nNINUMERICHOST = 1\nNINUMERICSERV = 2\nPACKETBROADCAST = 1\nPACKETFASTROUTE = 6\nPACKETHOST = 0\nPACKETLOOPBACK = 5\nPACKETMULTICAST = 2\nPACKETOTHERHOST = 3\nPACKETOUTGOING = 4\nPFCAN = 29\nPFPACKET = 17\nPFRDS = 21\nSCMCREDENTIALS = 2\nSCMJ1939DESTADDR = 1\nSCMJ1939DESTNAME = 2\nSCMJ1939ERRQUEUE = 4\nSCMJ1939PRIO = 3\nSCMRIGHTS = 1\nSHUTRD = 0\nSHUTRDWR = 2\nSHUTWR = 1\nSOCKCLOEXEC = <SocketKind.SOCKCLOEXEC: 524288>\nSOCKDGRAM = <SocketKind.SOCKDGRAM: 2>\nSOCKNONBLOCK = <SocketKind.SOCKNONBLOCK: 2048>\nSOCKRAW = <SocketKind.SOCKRAW: 3>\nSOCKRDM = <SocketKind.SOCKRDM: 4>\nSOCKSEQPACKET = <SocketKind.SOCKSEQPACKET: 5>\nSOCKSTREAM = <SocketKind.SOCKSTREAM: 1>\nSOLALG = 279\nSOLCANBASE = 100\nSOLCANRAW = 101\nSOLHCI = 0\nSOLIP = 0\nSOLRDS = 276\nSOLSOCKET = 1\nSOLTCP = 6\nSOLTIPC = 271\nSOLUDP = 17\nSOMAXCONN = 4096\nSOACCEPTCONN = 30\nSOBINDTODEVICE = 25\nSOBROADCAST = 6\nSODEBUG = 1\nSODOMAIN = 39\nSODONTROUTE = 5\nSOERROR = 4\nSOJ1939ERRQUEUE = 4\nSOJ1939FILTER = 1\nSOJ1939PROMISC = 2\nSOJ1939SENDPRIO = 3\nSOKEEPALIVE = 9\nSOLINGER = 13\nSOMARK = 36\nSOOOBINLINE = 10\nSOPASSCRED = 16\nSOPASSSEC = 34\nSOPEERCRED = 17\nSOPEERSEC = 31\nSOPRIORITY = 12\nSOPROTOCOL = 38\nSORCVBUF = 8\nSORCVLOWAT = 18\nSORCVTIMEO = 20\nSOREUSEADDR = 2\nSOREUSEPORT = 15\nSOSNDBUF = 7\nSOSNDLOWAT = 19\nSOSNDTIMEO = 21\nSOTYPE = 3\nSOVMSOCKETSBUFFERMAXSIZE = 2\nSOVMSOCKETSBUFFERMINSIZE = 1\nSOVMSOCKETSBUFFERSIZE = 0\nTCPCONGESTION = 13\nTCPCORK = 3\nTCPDEFERACCEPT = 9\nTCPFASTOPEN = 23\nTCPINFO = 11\nTCPKEEPCNT = 6\nTCPKEEPIDLE = 4\nTCPKEEPINTVL = 5\nTCPLINGER2 = 8\nTCPMAXSEG = 2\nTCPNODELAY = 1\nTCPNOTSENTLOWAT = 25\nTCPQUICKACK = 12\nTCPSYNCNT = 7\nTCPUSERTIMEOUT = 18\nTCPWINDOWCLAMP = 10\nTIPCADDRID = 3\nTIPCADDRNAME = 2\nTIPCADDRNAMESEQ = 1\nTIPCCFGSRV = 0\nTIPCCLUSTERSCOPE = 2\nTIPCCONNTIMEOUT = 130\nTIPCCRITICALIMPORTANCE = 3\nTIPCDESTDROPPABLE = 129\nTIPCHIGHIMPORTANCE = 2\nTIPCIMPORTANCE = 127\nTIPCLOWIMPORTANCE = 0\nTIPCMEDIUMIMPORTANCE = 1\nTIPCNODESCOPE = 3\nTIPCPUBLISHED = 1\nTIPCSRCDROPPABLE = 128\nTIPCSUBSCRTIMEOUT = 3\nTIPCSUBCANCEL = 4\nTIPCSUBPORTS = 1\nTIPCSUBSERVICE = 2\nTIPCTOPSRV = 1\nTIPCWAITFOREVER = -1\nTIPCWITHDRAWN = 2\nTIPCZONESCOPE = 1\nUDPLITERECVCSCOV = 11\nUDPLITESENDCSCOV = 10\nVMADDRCIDANY = 4294967295\nVMADDRCIDHOST = 2\nVMADDRPORTANY = 4294967295\nVMSOCKETSINVALIDVERSION = 4294967295\nall = ['fromfd', 'getfqdn', 'createconnection', 'createserver', ...\nhasipv6 = True\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3.10/socket.py\n\n",
            "subsections": []
        }
    },
    "summary": "socket",
    "flags": [],
    "examples": [],
    "see_also": []
}