8000 esp8266/modules/webrepl: Enforce only one concurrent WebREPL connection. · micropython/micropython@3f251ef · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3f251ef

Browse files
author
Paul Sokolovsky
committed
esp8266/modules/webrepl: Enforce only one concurrent WebREPL connection.
Concurrent WebREPL connections were never supported, now actually check for this.
1 parent 84679e0 commit 3f251ef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

esp8266/modules/webrepl.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ def setup_conn(port, accept_handler):
3131
def accept_conn(listen_sock):
3232
global client_s
3333
cl, remote_addr = listen_sock.accept()
34+
if uos.dupterm():
35+
print("\nConcurrent WebREPL connection from", remote_addr, "rejected")
36+
cl.close()
37+
return
3438
print("\nWebREPL connection from:", remote_addr)
3539
client_s = cl
3640
websocket_helper.server_handshake(cl)

0 commit comments

Comments
 (0)
0