mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-21 06:03:50 +00:00
Merge branch 'develop' into ping
This commit is contained in:
commit
1837ba46af
5 changed files with 71 additions and 86 deletions
|
|
@ -26,7 +26,7 @@ class TCPClient:
|
|||
def __init__(self, timeout=3):
|
||||
"""!Create a new instance
|
||||
|
||||
@param timeout: timout for the client in sec. (3)"""
|
||||
@param timeout: timeout for the client in sec. (3)"""
|
||||
try:
|
||||
self._sock = None
|
||||
self._timeout = timeout
|
||||
|
|
@ -36,7 +36,7 @@ class TCPClient:
|
|||
def connect(self, host="localhost", port=8080):
|
||||
"""!Connect to the server
|
||||
|
||||
@param host: Server IP address (localhost)
|
||||
@param host: Server IP address ("localhost")
|
||||
@param port: Server Port (8080)
|
||||
@return True or False"""
|
||||
try:
|
||||
|
|
@ -97,7 +97,7 @@ class TCPClient:
|
|||
@return received data"""
|
||||
try:
|
||||
received = str(self._sock.recv(1024), "utf-8")
|
||||
logging.debug("received: %d", received)
|
||||
logging.debug("received: %s", received)
|
||||
return received
|
||||
except AttributeError:
|
||||
logging.error("cannot receive - no connection established")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue