mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-21 17:11:58 +00:00
Catch OpenBMC disconnects and handle them better
This commit is contained in:
parent
008c1308b4
commit
a298ef8d74
@ -124,7 +124,10 @@ class TsmConsole(conapi.Console):
|
||||
|
||||
def recvdata(self):
|
||||
while self.connected:
|
||||
pendingdata = self.ws.recv()
|
||||
try:
|
||||
pendingdata = self.ws.recv()
|
||||
except websocket.WebSocketConnectionClosedException:
|
||||
pendingdata = ''
|
||||
if pendingdata == '':
|
||||
self.datacallback(conapi.ConsoleEvent.Disconnect)
|
||||
return
|
||||
@ -153,7 +156,10 @@ class TsmConsole(conapi.Console):
|
||||
return
|
||||
|
||||
def write(self, data):
|
||||
self.ws.send(data)
|
||||
try:
|
||||
self.ws.send(data)
|
||||
except websocket.WebSocketConnectionClosedException:
|
||||
self.datacallback(conapi.ConsoleEvent.Disconnect)
|
||||
|
||||
def close(self):
|
||||
if self.recvr:
|
||||
|
Loading…
Reference in New Issue
Block a user