8000 Fixed #24. Now you can return False from multiplexed connection on_op… · pythonanywhere/tornadio2@955758d · GitHub
[go: up one dir, main page]

Skip to content

Commit 955758d

Browse files
committed
Fixed mrjoes#24. Now you can return False from multiplexed connection on_open to close it.
1 parent 637619d commit 955758d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/multiplexed/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
$("#chat").append("<div>" + data + "</div>");
1919
});
2020

21-
2221
function getPrintableDate(date) {
2322
return date.getFullYear().toString() + '/' +
2423
(date.getMonth()+1).toString() + '/' +

tornadio2/session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ def connect_endpoint(self, url):
301301

302302
info = ConnectionInfo(self.remote_ip, args, dict())
303303

304-
conn.on_open(info)
304+
if conn.on_open(info) == False:
305+
self.disconnect_endpoint(endpoint)
305306

306307
def disconnect_endpoint(self, endpoint):
307308
"""Disconnect endpoint

0 commit comments

Comments
 (0)
0