diff options
Diffstat (limited to 'inputs/TCPInput.py')
-rw-r--r-- | inputs/TCPInput.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/inputs/TCPInput.py b/inputs/TCPInput.py index 513b853..2bc69ef 100644 --- a/inputs/TCPInput.py +++ b/inputs/TCPInput.py @@ -21,15 +21,15 @@ class TCPInput(Input): def sensingLoop(self): data = self.conn.recv(self.BUFFER_SIZE) main_log.debug('Incoming data', data) + if not data or 'end' in data: # data end, close socket main_log.debug('End in data') print 'end of stream' self.IS_RESPONDING = 0 self.conn.close() self.sock.close() - - if self.IS_RESPONDING == 1: # if 'responding', respond to the received data - #dataDict = json.loads(data) + + if self.IS_RESPONDING == 1: # if 'responding', respond to the received data try: for datagroup in data.split('\n'): if datagroup != None and datagroup != '': |