def clientActionNone(self, connection, ip, port):
     logging.info("Waiting  for data ...")
     inputFromClient = ScssProtocol.receiveNoneData(connection, self.max_buffer_size)
     logging.info("Received: {}".format(str(inputFromClient)))
     logging.info("Sending response ...")
     ScssProtocol.sendNoneData(connection, inputFromClient)
     logging.info("Response sent.")
     connection.close()
     logging.info('Connection ' + ip + ':' + port + " ended")
Example #2
0
    def sendNone(self, data):
        receivedString = None
        try:
            logging.debug("Send [None] data.")
            ScssProtocol.sendNoneData(self.clientSocket, data)
            logging.debug("Data sent.")
            receivedString = ScssProtocol.receiveNoneData(self.clientSocket, self.max_buffer_size)
            logging.debug("Data received.")
            logging.debug("Data [{}]".format(receivedString))
        except socket.timeout:
            logging.debug("Connection timeout.")

        return receivedString
 def clientActionNone(self, connection, ip, port):
     try:
         idbBillCommand = ScssProtocol.receiveNoneData(connection, self.max_buffer_size)
         idbBillRespond = ProcessQuery.execute(self.jscConfigFilePath, self.connectionName, idbBillCommand)
         if not idbBillRespond:
             idbBillRespond = ''
         else:
             idbBillRespond = str(idbBillRespond)
         ScssProtocol.sendNoneData(connection, idbBillRespond)
     except:
         pass
     finally:
         connection.close()
         logging.info('Connection ' + ip + ':' + port + " ended")
 def clientActionNone(self, connection, ip, port):
     try:
         messengerRequest = ScssProtocol.receiveNoneData(
             connection, self.max_buffer_size)
         messengerRespond = ProcessRequest.execute(self.jscConfigFilePath,
                                                   self.connectionName,
                                                   messengerRequest)
         if not messengerRespond:
             messengerRespond = ''
         else:
             messengerRespond = str(messengerRespond)
         ScssProtocol.sendNoneData(connection, messengerRespond)
     except:
         pass
     finally:
         connection.close()
         logging.info('Connection ' + ip + ':' + port + " ended")