From 2e4d4abb29402298377b89ae89081d7b9510712b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 12 Jul 2020 10:28:57 +0800 Subject: [PATCH] bugfix --- appPublic/sockPackage.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/appPublic/sockPackage.py b/appPublic/sockPackage.py index 3781237..16ff738 100755 --- a/appPublic/sockPackage.py +++ b/appPublic/sockPackage.py @@ -3,10 +3,6 @@ import time import threading import sys import socket -from mylog import mylog - -def logit(s) : - mylog(__file__ + ':' + s) def get_free_local_addr(): with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s: @@ -56,7 +52,7 @@ class SocketServer(threading.Thread) : self.sock.listen(self.max_c) self.ready = True except Exception as e: - logit('setSocketServer() Error:%s\nhost=%s,port=%d' % (e,self.host,self.port)) + print('setSocketServer() Error:%s\nhost=%s,port=%d' % (e,self.host,self.port)) pass def run(self) : @@ -104,7 +100,7 @@ class SocketClient : self.ready = True except Exception as e: self.ready = False - logit('Socket connect error,%s\nhost=%s,port=%s' % (e,self.host,self.port)) + print('Socket connect error,%s\nhost=%s,port=%s' % (e,self.host,self.port)) raise SocketClientError('connect error') def read(self,size) : @@ -112,14 +108,14 @@ class SocketClient : data = self.sock.recv(size) return data except Exception as e: - logit('recv error,%s' % e) + print('recv error,%s' % e) raise SocketClientError('recv error') def write(self,data) : try : self.sock.send(data) except Exception as e: - logit('recv error,%s' % e) + print('recv error,%s' % e) raise SocketClientError('send error') def close(self) :