fix: impl quic listener

This commit is contained in:
Akash Mondal
2025-06-10 21:40:21 +00:00
committed by lla-dane
parent 446a22b0f0
commit 54b3055eaa
13 changed files with 1687 additions and 150 deletions

View File

@ -5,16 +5,17 @@ QUIC Stream implementation
from types import (
TracebackType,
)
from typing import TYPE_CHECKING, cast
import trio
from libp2p.abc import (
IMuxedStream,
)
if TYPE_CHECKING:
from libp2p.abc import IMuxedStream
from .connection import QUICConnection
else:
IMuxedStream = cast(type, object)
from .connection import (
QUICConnection,
)
from .exceptions import (
QUICStreamError,
)
@ -41,7 +42,7 @@ class QUICStream(IMuxedStream):
self._receive_event = trio.Event()
self._close_event = trio.Event()
async def read(self, n: int = -1) -> bytes:
async def read(self, n: int | None = -1) -> bytes:
"""Read data from the stream."""
if self._closed:
raise QUICStreamError("Stream is closed")