def __init__(self, bind=None, addr_type=AddrType.IPV6, reuse=False):
    '\n        Initialize a UDP socket, then call superclass init for socket options\n        and binding.\n\n        :param tuple bind:\n            Optional tuple of (`str`, `int`, `str`) describing respectively the\n            address and port to bind to, and an optional description.\n        :param addr_type:\n            Socket domain. Must be one of :const:`~lib.types.AddrType.IPV4`,\n            :const:`~lib.types.AddrType.IPV6` (default).\n        :param reuse:\n            Boolean value indicating whether SO_REUSEADDR option should be set.\n        '
    assert (addr_type in (AddrType.IPV4, AddrType.IPV6))
    self._addr_type = addr_type
    af_domain = AF_INET6
    if (self._addr_type == AddrType.IPV4):
        af_domain = AF_INET
    self.sock = socket(af_domain, SOCK_DGRAM)
    if reuse:
        self.sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
    self.port = None
    if bind:
        self.bind(*bind)
    self.active = True
Initialize a UDP socket, then call superclass init for socket options
and binding.

:param tuple bind:
    Optional tuple of (`str`, `int`, `str`) describing respectively the
    address and port to bind to, and an optional description.
:param addr_type:
    Socket domain. Must be one of :const:`~lib.types.AddrType.IPV4`,
    :const:`~lib.types.AddrType.IPV6` (default).
:param reuse:
    Boolean value indicating whether SO_REUSEADDR option should be set.
def __init__(self, bind=None, addr_type=AddrType.IPV6, reuse=False):
    '\n        Initialize a UDP socket, then call superclass init for socket options\n        and binding.\n\n        :param tuple bind:\n            Optional tuple of (`str`, `int`, `str`) describing respectively the\n            address and port to bind to, and an optional description.\n        :param addr_type:\n            Socket domain. Must be one of :const:`~lib.types.AddrType.IPV4`,\n            :const:`~lib.types.AddrType.IPV6` (default).\n        :param reuse:\n            Boolean value indicating whether SO_REUSEADDR option should be set.\n        '
    assert (addr_type in (AddrType.IPV4, AddrType.IPV6))
    self._addr_type = addr_type
    af_domain = AF_INET6
    if (self._addr_type == AddrType.IPV4):
        af_domain = AF_INET
    self.sock = socket(af_domain, SOCK_DGRAM)
    if reuse:
        self.sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
    self.port = None
    if bind:
        self.bind(*bind)
    self.active = True