mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Update tcp.py
This commit is contained in:
parent
ebe1f3433f
commit
7c58bb34af
1 changed files with 2 additions and 2 deletions
|
|
@ -456,7 +456,7 @@ class TCP:
|
||||||
try:
|
try:
|
||||||
self.writer.close()
|
self.writer.close()
|
||||||
await asyncio.wait_for(self.writer.wait_closed(), self.TIMEOUT)
|
await asyncio.wait_for(self.writer.wait_closed(), self.TIMEOUT)
|
||||||
except Exception:
|
except (OSError, asyncio.TimeoutError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def send(self, data: bytes) -> None:
|
async def send(self, data: bytes) -> None:
|
||||||
|
|
@ -468,7 +468,7 @@ class TCP:
|
||||||
try:
|
try:
|
||||||
self.writer.write(data)
|
self.writer.write(data)
|
||||||
await self.writer.drain()
|
await self.writer.drain()
|
||||||
except Exception as e:
|
except (OSError, asyncio.TimeoutError) as e:
|
||||||
raise OSError(e)
|
raise OSError(e)
|
||||||
|
|
||||||
async def recv(self, length: int = 0) -> Optional[bytes]:
|
async def recv(self, length: int = 0) -> Optional[bytes]:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue