mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Mplex: catch RawConnError when writing
Also, do nothing in `MplexStream.reset` if `MuxedConnUnavailable` is raised when sending the message.
This commit is contained in:
@ -166,7 +166,13 @@ class Mplex(IMuxedConn):
|
||||
:param _bytes: byte array to write
|
||||
:return: length written
|
||||
"""
|
||||
await self.secured_conn.write(_bytes)
|
||||
try:
|
||||
await self.secured_conn.write(_bytes)
|
||||
except RawConnError as e:
|
||||
raise MplexUnavailable(
|
||||
"failed to write message to the underlying connection"
|
||||
) from e
|
||||
|
||||
return len(_bytes)
|
||||
|
||||
async def handle_incoming(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user