Skip to content

Commit 23bd21a

Browse files
jgosmanntcstewar
authored andcommitted
Ensure proper WebSocket shutdown.
WebSockets could end up hanging in the hot loop waiting for further messages.
1 parent 2134426 commit 23bd21a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nengo_gui/guibackend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def browse(self):
171171
r.append(b'<li class="directory collapsed">'
172172
b'<a href="#" rel="' + ff + b'/">' + f + b'</a></li>')
173173
else:
174-
e = os.path.splitext(f)[1][1:] # get .ext and remove dot
174+
e = os.path.splitext(f)[1][1:] # get .ext and remove dot
175175
if e == 'py':
176176
e = e.encode('utf-8')
177177
f = f.encode('utf-8')
@@ -213,7 +213,7 @@ def ws_default(self):
213213
uid = int(self.query['uid'][0])
214214

215215
component = gui.component_uids[uid]
216-
while True:
216+
while self.ws.state is server.WebSocket.ST_OPEN:
217217
try:
218218
if component.replace_with is not None:
219219
component.finish()

0 commit comments

Comments
 (0)