pythonasyncioeventletgeventlong-pollinglow-latencysocket-iosocketiosocketio-serverweb-serverwebsocket
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
478 B
21 lines
478 B
import time
|
|
import socketio
|
|
|
|
|
|
def test():
|
|
s = socketio.Server(async_handlers=False)
|
|
start = time.time()
|
|
count = 0
|
|
s._handle_eio_connect('123', 'environ')
|
|
s._handle_eio_message('123', '0')
|
|
while True:
|
|
s._handle_eio_message('123', '2["test","hello"]')
|
|
count += 1
|
|
if time.time() - start >= 5:
|
|
break
|
|
return count
|
|
|
|
|
|
if __name__ == '__main__':
|
|
count = test()
|
|
print('server_receive:', count, 'packets received.')
|
|
|