mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Fix linter error from merge in #315.
This commit is contained in:
@ -13,9 +13,8 @@ logger = logging.getLogger("libp2p.host.ping")
|
|||||||
|
|
||||||
|
|
||||||
async def _handle_ping(stream: INetStream, peer_id: PeerID) -> bool:
|
async def _handle_ping(stream: INetStream, peer_id: PeerID) -> bool:
|
||||||
"""
|
"""Return a boolean indicating if we expect more pings from the peer at
|
||||||
Return a boolean indicating if we expect more pings from the peer at ``peer_id``.
|
``peer_id``."""
|
||||||
"""
|
|
||||||
try:
|
try:
|
||||||
payload = await asyncio.wait_for(stream.read(PING_LENGTH), RESP_TIMEOUT)
|
payload = await asyncio.wait_for(stream.read(PING_LENGTH), RESP_TIMEOUT)
|
||||||
except asyncio.TimeoutError as error:
|
except asyncio.TimeoutError as error:
|
||||||
@ -40,10 +39,8 @@ async def _handle_ping(stream: INetStream, peer_id: PeerID) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
async def handle_ping(stream: INetStream) -> None:
|
async def handle_ping(stream: INetStream) -> None:
|
||||||
"""
|
"""``handle_ping`` responds to incoming ping requests until one side errors
|
||||||
``handle_ping`` responds to incoming ping requests until one side
|
or closes the ``stream``."""
|
||||||
errors or closes the ``stream``.
|
|
||||||
"""
|
|
||||||
peer_id = stream.muxed_conn.peer_id
|
peer_id = stream.muxed_conn.peer_id
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
Reference in New Issue
Block a user