Skip to content

Commit

Permalink
fix-code: lazydock\pml\server.py: VClient: remove _run_server method …
Browse files Browse the repository at this point in the history
…from VClient

Prevent VClient from being runnable as a server by removing the _run_server method. This change
ensures that the VClient class adheres strictly to its intended functionality as a client.
  • Loading branch information
BHM-Bob committed Sep 4, 2024
1 parent cfd6b39 commit f7c01e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lazydock/pml/server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''
Date: 2024-09-01 20:33:00
LastEditors: BHM-Bob [email protected]
LastEditTime: 2024-09-03 15:46:33
LastEditTime: 2024-09-04 21:26:46
Description:
'''
import pickle
Expand Down Expand Up @@ -118,6 +118,9 @@ def __init__(self, ip: str = 'localhost', port: int = 8085) -> None:
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1 * 1024 * 1024) # set socket send buffer size to 1MB
self.socket.connect((ip, port))

def _run_server(self) -> None:
raise NotImplementedError('VClient cannot run as a server now')

def send_action(self, api: str, fn: str, *args, **kwargs) -> Any:
data = pickle.dumps((api, fn, args, kwargs))
Expand Down

0 comments on commit f7c01e6

Please sign in to comment.