Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

Commit ce3a1a2

Browse files
committed
Rework loop which collects the local python sockets for read and writing.
1 parent 7bf04b3 commit ce3a1a2

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

stream/ws_client.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -322,19 +322,21 @@ def _proxy(self):
322322
rlist.append(self.websocket)
323323
if kubernetes_data:
324324
wlist.append(self.websocket)
325-
all_closed = True
325+
local_all_closed = True
326326
for port in self.local_ports.values():
327327
if port.python.fileno() != -1:
328-
if port.data:
329-
wlist.append(port.python)
330-
all_closed = False
328+
if self.websocket.connected:
329+
rlist.append(port.python)
330+
if port.data:
331+
wlist.append(port.python)
332+
local_all_closed = False
331333
else:
332-
if self.websocket.connected:
333-
rlist.append(port.python)
334-
all_closed = False
334+
if port.data:
335+
wlist.append(port.python)
336+
local_all_closed = False
335337
else:
336338
port.python.close()
337-
if all_closed and (not self.websocket.connected or not kubernetes_data):
339+
if local_all_closed and not (self.websocket.connected and kubernetes_data):
338340
self.websocket.close()
339341
return
340342
r, w, _ = select.select(rlist, wlist, [])

0 commit comments

Comments
 (0)