File: //usr/lib/python3/dist-packages/twisted/internet/__pycache__/udp.cpython-38.pyc
U
��W[�H � @ s� d Z ddlmZmZ ddlZddlZddlZddlZddlm Z ddl
mZ edkr�ddlm
Z
ddlmZmZmZ dd lmZmZmZ dd
lmZ ddlmZ ee
eegZeeeegZeZeZe
ZeZn8ddlmZmZmZmZmZ dd
lmZ eeegZegZddlmZm Z m!Z! ddl"m#Z#m$Z$ ddl%m&Z& ddlm'Z'm(Z(m)Z) e e)j*e)j+e)j,�G dd� dej-��Z.e&G dd� d��Z/e e)j0�G dd� de/e.��Z1dS )a�
Various asynchronous UDP classes.
Please do not use this module directly.
@var _sockErrReadIgnore: list of symbolic error constants (from the C{errno}
module) representing socket errors where the error is temporary and can be
ignored.
@var _sockErrReadRefuse: list of symbolic error constants (from the C{errno}
module) representing socket errors that indicate connection refused.
� )�division�absolute_importN)�implementer)�platformTypeZwin32)�WSAEWOULDBLOCK)�WSAEINTR�WSAEMSGSIZE�WSAETIMEDOUT)�WSAECONNREFUSED�
WSAECONNRESET�WSAENETRESET)�WSAEINPROGRESS)�WSAENOPROTOOPT)�EWOULDBLOCK�EINTR�EMSGSIZE�ECONNREFUSED�EAGAIN)�ENOPROTOOPT)�base�defer�address)�log�failure)� _oldStyle)�abstract�error�
interfacesc @ s� e Zd ZdZejZejZdZ dZ
dZd0dd�Ze
dd � �Zd
d� Zdd
� Zdd� Zdd� Zdd� Zdd� Zd1dd�Zdd� Zdd� Zdd� Zdd� Zd d!� Zd2d"d#�Zd$d%� Zd&d'� Zd(d)� Zd*d+� Zd,d-� Z d.d/� Z!dS )3�Porta�
UDP port, listening for packets.
@ivar maxThroughput: Maximum number of bytes read in one event
loop iteration.
@ivar addressFamily: L{socket.AF_INET} or L{socket.AF_INET6}, depending on
whether this port is listening on an IPv4 address or an IPv6 address.
@ivar _realPortNumber: Actual port number being listened on. The
value will be L{None} until this L{Port} is listening.
@ivar _preexistingSocket: If not L{None}, a L{socket.socket} instance which
was created and initialized outside of the reactor and will be used to
listen for connections (instead of a new socket being created by this
L{Port}).
i N� � c C s@ t j�| |� || _|| _|| _|| _| �� d| _| � � dS )a
@param port: A port number on which to listen.
@type port: L{int}
@param proto: A C{DatagramProtocol} instance which will be
connected to the given C{port}.
@type proto: L{twisted.internet.protocol.DatagramProtocol}
@param interface: The local IPv4 or IPv6 address to which to bind;
defaults to '', ie all IPv4 addresses.
@type interface: L{str}
@param maxPacketSize: The maximum packet size to accept.
@type maxPacketSize: L{int}
@param reactor: A reactor which will notify this C{Port} when
its socket is ready for reading or writing. Defaults to
L{None}, ie the default global reactor.
@type reactor: L{interfaces.IReactorFDSet}
N)
r �BasePort�__init__�port�protocol�
maxPacketSize� interface� setLogStr�_connectedAddr�_setAddressFamily)�selfr# �protor&