In Windows, create new console and hide it

Minor Correction:
* logging
* change status return type
This commit is contained in:
kale4eat
2024-03-06 11:19:55 +09:00
parent 2ab025d5fe
commit 45c6bde2e7
2 changed files with 19 additions and 7 deletions

View File

@@ -38,9 +38,18 @@ class WorkerClient:
return response.get("return")
def status(self):
send_data(self.sock, {"request-type": RequestType.STATUS})
return receive_data(self.sock)
data = {"request-type": RequestType.STATUS}
logger.trace(f"client sends request: {data}")
send_data(self.sock, data)
logger.trace("client sent request successfully")
response = receive_data(self.sock)
logger.trace(f"client received response: {response}")
return response.get("client-count")
def quit_server(self):
send_data(self.sock, {"request-type": RequestType.QUIT_SERVER})
receive_data(self.sock)
data = {"request-type": RequestType.QUIT_SERVER}
logger.trace(f"client sends request: {data}")
send_data(self.sock, data)
logger.trace("client sent request successfully")
response = receive_data(self.sock)
logger.trace(f"client received response: {response}")