def _send_obj(self, obj): """Send object to root""" obj_data = pickle.dumps(obj) packet = network_util.construct_packet('', network_util.DataType.PICKLE, obj_data) return self._forward_packet(packet)
def _send_msg(self, node, data): """Send text to node""" route = self.routes[node] packet = network_util.construct_packet(route, network_util.DataType.TEXT, data) self.packet_queue[route[0]].put(packet)
def _send_obj(self, node, obj): """Send object to node""" route = self.routes[node] obj_data = pickle.dumps(obj) packet = network_util.construct_packet(route, network_util.DataType.PICKLE, obj_data) self.packet_queue[route[0]].put(packet)
def _send_image(self, cam_id, image_data): """Send image to root""" id_data = struct.pack('H', cam_id) packet = network_util.construct_packet('', network_util.DataType.IMAGE, id_data + image_data) return self._forward_packet(packet)
def _send_msg(self, data, **kwargs): """Send text to root""" packet = network_util.construct_packet('', network_util.DataType.TEXT, data) return self._forward_packet(packet, **kwargs)