def mrecvfrom(self, bufsize, service=None):
     if not service:
         service = self.connectService
     data, addr = dust_socket.recvfrom(self, bufsize)
     if not data:
         print('Multiplex: No data')
         return None, None, None
     multiplex = MultiplexMessage()
     multiplex.decodeMultiplexMessage(data)
     return multiplex.data, addr, multiplex.serviceName
Beispiel #2
0
 def mrecv(self, bufsize, service=None):
   if not service:
     service=self.connectService
   data=lite_socket.recv(self, bufsize)
   if not data:
     return None
   multiplex=MultiplexMessage()
   multiplex.decodeMultiplexMessage(data)
   if service and multiplex.serviceName!=service:
     print('Bad multiplex service name', multiplex.serviceName, 'should be ', self.connectService)
     return None
   return multiplex.data
Beispiel #3
0
 def mrecv(self, bufsize, service=None):
     if not service:
         service = self.connectService
     data = lite_socket.recv(self, bufsize)
     if not data:
         return None
     multiplex = MultiplexMessage()
     multiplex.decodeMultiplexMessage(data)
     if service and multiplex.serviceName != service:
         print('Bad multiplex service name', multiplex.serviceName,
               'should be ', self.connectService)
         return None
     return multiplex.data
Beispiel #4
0
 def msendto(self, data, addr, service=None):
     if not service:
         service = self.connectService
     multiplex = MultiplexMessage()
     multiplex.createMultiplexMessage(service, data)
     list_socket.sendto(self, multiplex.message, addr)
Beispiel #5
0
 def msendto(self, data, addr, service=None):
   if not service:
     service=self.connectService
   multiplex=MultiplexMessage()
   multiplex.createMultiplexMessage(service, data)
   list_socket.sendto(self, multiplex.message, addr)