twisted.internet.interfaces.IReactorSocket.adoptDatagramPort(fileDescriptor, addressFamily, protocol, maxPacketSize=8192)
method documentationtwisted.internet.interfaces.IReactorSocket
View Source
Add an existing listening SOCK_DGRAM socket to the reactor to monitor for read and write readiness.
Parameters | fileDescriptor | A file descriptor associated with a socket which is already bound to an
address and marked as listening. The socket must be set non-blocking. Any
additional flags (for example, close-on-exec) must also be set by
application code. Application code is responsible for closing the file
descriptor, which may be done as soon as adoptDatagramPort
returns. (type: int ) |
addressFamily | The address family or domain of the socket. For example, socket.AF_INET6 . (type: int ) | |
protocol | A DatagramProtocol
instance to connect to a UDP transport. (type: DatagramProtocol ) | |
maxPacketSize | The maximum packet size to accept. (type: int ) | |
Returns | An object providing IListeningPort . | |
Raises | UnsupportedAddressFamily | If the given address family is not supported by this reactor, or not supported with the given socket type. |
UnsupportedSocketType | If the given socket type is not supported by this reactor, or not supported with the given socket type. |