Exemplo n.º 1
0
 def frecv(self):
   data, serviceName=self.mrecv(1024)
   if not data:
     return None, None
   file=FileMessage()
   file.decodeFileMessage(data)
   if serviceName!='file':
     print('Bad file service name', file.serviceName)
     return None, None
   return file.headers, file.data
 def frecv(self):
     data, serviceName = self.mrecv(1024)
     if not data:
         return None, None
     file = FileMessage()
     file.decodeFileMessage(data)
     if serviceName != 'file':
         print('Bad file service name', file.serviceName)
         return None, None
     return file.headers, file.data
Exemplo n.º 3
0
  def handle(self, msock, msg, addr):
    print('-----------------')
    print(msg.decode('ascii'))

    fmsg=FileMessage()
    fmsg.decodeFileMessage(msg)
    cmd=fmsg.headers['command']
    if cmd in self.commands:
      f=self.commands[cmd]
      f(msock, fmsg.headers, fmsg.data, addr)
    else:
      print('Unknown file command', cmd)
      return
Exemplo n.º 4
0
    def handle(self, msock, msg, addr):
        print('-----------------')
        print(msg.decode('ascii'))

        fmsg = FileMessage()
        fmsg.decodeFileMessage(msg)
        cmd = fmsg.headers['command']
        if cmd in self.commands:
            f = self.commands[cmd]
            f(msock, fmsg.headers, fmsg.data, addr)
        else:
            print('Unknown file command', cmd)
            return