Exemplo n.º 1
0
 def sendData(self, msg, sock=None):
     try:
         super(ChatClientBase, self).sendData(msg, sock)
     except socket.error as err:
         self.log(
             'Fail to send data "{}" to server / client, error = {}'.format(
                 utils.lengthLimit(msg), err.args))
         if self.isOnline():
             self.stop(False)
Exemplo n.º 2
0
 def sendCommand(self, commandData):
     if self.isOnline():
         self.log('Sending command "{}" to the client'.format(
             utils.lengthLimit(utils.commandData_to_string(commandData))))
         self.sendData(json.dumps(commandData))
Exemplo n.º 3
0
 def sendMessage(self, messageData):
     if self.isOnline():
         self.log('Sending message "{}" to the client'.format(
             utils.lengthLimit(utils.messageData_to_string(messageData))))
         self.sendData(json.dumps(messageData))