'Fake L{IReactorSocket.adoptDatagramPort}, that logs the call and returns
a fake L{IListeningPort}.
@see: L{twisted.internet.interfaces.IReactorSocket.adoptDatagramPort}'

def adoptDatagramPort(self, fileno, addressFamily, protocol, maxPacketSize=8192):

    if (addressFamily == AF_INET):
        addr = IPv4Address('UDP', '0.0.0.0', 1234)
    elif (addressFamily == AF_INET6):
        addr = IPv6Address('UDP', '::', 1234)
    else:
        raise UnsupportedAddressFamily()
    self.adoptedPorts.append((fileno, addressFamily, protocol, maxPacketSize))
    return _FakePort(addr)
