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")
Exemplo n.º 2
0
    def sendToken(self, data):
        receivedString = None
        try:
            if ScssProtocol.sendTokenData(self.clientSocket, self.connectionSecurity, data):
                receivedString = ScssProtocol.receiveTokenData(self.clientSocket, self.connectionSecurity,
                                                               self.max_buffer_size)
        except socket.timeout:
            logging.debug("Connection timeout.")

        return receivedString
 def clientActionToken(self, connection, ip, port):
     try:
         data = ScssProtocol.receiveTokenData(connection, self.connectionSecurity, self.max_buffer_size)
         logging.info("Received: {}".format(data))
         ScssProtocol.sendTokenData(connection, self.connectionSecurity, data)
     except:
         logging.debug("Error for client action token.")
         logging.debug(str(traceback.format_exc()))
     finally:
         connection.close()
         logging.info('Connection ' + ip + ':' + port + " ended")
Exemplo n.º 4
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
Exemplo n.º 5
0
 def clientActionToken(self, connection, ip, port):
     try:
         idbBillCommand = ScssProtocol.receiveTokenData(connection, self.connectionSecurity, self.max_buffer_size)
         idbBillRespond = ProcessQuery.execute(self.jscConfigFilePath, self.connectionName, idbBillCommand)
         if not idbBillRespond:
             idbBillRespond = ''
         else:
             idbBillRespond = str(idbBillRespond)
         ScssProtocol.sendTokenData(connection, self.connectionSecurity, 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")