PHP 8.2.30
Preview: _asyncbackend.py Size: 2.34 KB
//opt/hc_python/lib/python3.12/site-packages/dns/_asyncbackend.py

# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license

# This is a nullcontext for both sync and async.  3.7 has a nullcontext,
# but it is only for sync use.


class NullContext:
    def __init__(self, enter_result=None):
        self.enter_result = enter_result

    def __enter__(self):
        return self.enter_result

    def __exit__(self, exc_type, exc_value, traceback):
        pass

    async def __aenter__(self):
        return self.enter_result

    async def __aexit__(self, exc_type, exc_value, traceback):
        pass


# These are declared here so backends can import them without creating
# circular dependencies with dns.asyncbackend.


class Socket:  # pragma: no cover
    def __init__(self, family: int, type: int):
        self.family = family
        self.type = type

    async def close(self):
        pass

    async def getpeername(self):
        raise NotImplementedError

    async def getsockname(self):
        raise NotImplementedError

    async def getpeercert(self, timeout):
        raise NotImplementedError

    async def __aenter__(self):
        return self

    async def __aexit__(self, exc_type, exc_value, traceback):
        await self.close()


class DatagramSocket(Socket):  # pragma: no cover
    async def sendto(self, what, destination, timeout):
        raise NotImplementedError

    async def recvfrom(self, size, timeout):
        raise NotImplementedError


class StreamSocket(Socket):  # pragma: no cover
    async def sendall(self, what, timeout):
        raise NotImplementedError

    async def recv(self, size, timeout):
        raise NotImplementedError


class NullTransport:
    async def connect_tcp(self, host, port, timeout, local_address):
        raise NotImplementedError


class Backend:  # pragma: no cover
    def name(self):
        return "unknown"

    async def make_socket(
        self,
        af,
        socktype,
        proto=0,
        source=None,
        destination=None,
        timeout=None,
        ssl_context=None,
        server_hostname=None,
    ):
        raise NotImplementedError

    def datagram_connection_required(self):
        return False

    async def sleep(self, interval):
        raise NotImplementedError

    def get_transport_class(self):
        raise NotImplementedError

    async def wait_for(self, awaitable, timeout):
        raise NotImplementedError

Directory Contents

Dirs: 4 × Files: 56

Name Size Perms Modified Actions
- drwxr-xr-x 2025-04-04 08:02:00
Edit Download
quic DIR
- drwxr-xr-x 2025-04-04 08:02:00
Edit Download
rdtypes DIR
- drwxr-xr-x 2025-04-04 08:02:00
Edit Download
- drwxr-xr-x 2025-04-04 08:02:00
Edit Download
2.73 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
30.10 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
17.43 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
40.74 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
1.76 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
3.88 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
16.69 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
4.14 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
3.60 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
5.81 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
2.69 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
2.09 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
1.97 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
5.64 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
2.49 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
6.40 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
66.59 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
41.78 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
3.91 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
9.88 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
12.37 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
2.67 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
0 B lrw-r--r-- 2025-04-04 08:02:00
Edit Download
54.98 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
4.06 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
30.29 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
2.91 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
16.27 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
7.27 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
10.99 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
72.00 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
3.74 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
8.96 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
3.52 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
9.00 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
23.03 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
22.06 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
11.15 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
2.57 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
2.91 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
11.96 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
1.88 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
11.49 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
8.67 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
2.76 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
12.96 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
50.87 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
27.27 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
690 B lrw-r--r-- 2025-04-04 08:02:00
Edit Download
2.34 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
8.84 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
5.12 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
2.43 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
2.40 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
8.27 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download
1.62 KB lrw-r--r-- 2025-04-04 08:02:00
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).