esp8266/modules/webrepl: Enforce only one concurrent WebREPL connection.

Concurrent WebREPL connections were never supported, now actually check
for this.
This commit is contained in:
Paul Sokolovsky 2016-10-20 16:49:45 +03:00
parent 84679e0c06
commit 3f251efb9b

View File

@ -31,6 +31,10 @@ def setup_conn(port, accept_handler):
def accept_conn(listen_sock):
global client_s
cl, remote_addr = listen_sock.accept()
if uos.dupterm():
print("\nConcurrent WebREPL connection from", remote_addr, "rejected")
cl.close()
return
print("\nWebREPL connection from:", remote_addr)
client_s = cl
websocket_helper.server_handshake(cl)