Merge branch 'develop' into ping

This commit is contained in:
Bastian Schroll 2018-09-21 22:09:30 +02:00 committed by GitHub
commit 1837ba46af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 71 additions and 86 deletions

View file

@ -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")