mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-14 05:12:09 +00:00
signalling/server: python 3.8 asyncio has it's own TimeoutError
This commit is contained in:
parent
3a86a37c03
commit
7445fc4928
1 changed files with 2 additions and 3 deletions
|
@ -15,8 +15,7 @@ import asyncio
|
||||||
import websockets
|
import websockets
|
||||||
import argparse
|
import argparse
|
||||||
import http
|
import http
|
||||||
|
import concurrent
|
||||||
from concurrent.futures._base import TimeoutError
|
|
||||||
|
|
||||||
class WebRTCSimpleServer(object):
|
class WebRTCSimpleServer(object):
|
||||||
|
|
||||||
|
@ -58,7 +57,7 @@ class WebRTCSimpleServer(object):
|
||||||
while msg is None:
|
while msg is None:
|
||||||
try:
|
try:
|
||||||
msg = await asyncio.wait_for(ws.recv(), self.keepalive_timeout)
|
msg = await asyncio.wait_for(ws.recv(), self.keepalive_timeout)
|
||||||
except TimeoutError:
|
except (asyncio.exceptions.TimeoutError, concurrent.futures._base.TimeoutError):
|
||||||
print('Sending keepalive ping to {!r} in recv'.format(raddr))
|
print('Sending keepalive ping to {!r} in recv'.format(raddr))
|
||||||
await ws.ping()
|
await ws.ping()
|
||||||
return msg
|
return msg
|
||||||
|
|
Loading…
Reference in a new issue