MCPcopy Create free account
hub / github.com/ambianic/peerfetch / _ping

Function _ping

python/src/peerfetch/proxy.py:222–231  ·  view source on GitHub ↗
(peer_connection=None, stop_flag=None)

Source from the content-addressed store, hash-verified

220
221
222async def _ping(peer_connection=None, stop_flag=None):
223 while not stop_flag.is_set():
224 # send HTTP 202 Accepted status code to inform
225 # client that we are still waiting on the http
226 # server to complete its response
227 ping_as_json = json.dumps({'status': 202})
228 await peer_connection.send(ping_as_json)
229 logger.info('webrtc peer: http proxy response to client ping. '
230 'Keeping datachannel alive.')
231 await asyncio.sleep(1)
232
233
234def _setPeerConnectionHandlers(peerConnection):

Callers 1

pc_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected