mirror of https://git.48k.eu/ogclient
#999 Fix ogClient session command
Disconnect gracefully from ogServer after booting OS, the script to start the OS calls kexec, so everything is gone after it. For Windows, this results in a reboot. This commit also improves the disconnect function to make sure the disconnection is synchronous.more_events
parent
de129f7449
commit
0593119352
|
@ -119,6 +119,7 @@ class ogClient:
|
|||
|
||||
def disconnect(self):
|
||||
self.state = State.FORCE_DISCONNECTED
|
||||
self.sock.shutdown(socket.SHUT_RDWR)
|
||||
self.sock.close()
|
||||
|
||||
def run(self):
|
||||
|
|
|
@ -120,7 +120,7 @@ class ogThread():
|
|||
|
||||
response = restResponse(ogResponses.OK)
|
||||
client.send(response.get())
|
||||
ogRest.state = ThreadState.IDLE
|
||||
client.disconnect()
|
||||
|
||||
def software(client, request, path, ogRest):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue