| 220 | |
| 221 | |
| 222 | async 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 | |
| 234 | def _setPeerConnectionHandlers(peerConnection): |