예제 #1
0
def on_outbox_packet(outpacket,
                     wide,
                     callbacks,
                     target=None,
                     route=None,
                     response_timeout=None,
                     keep_alive=True):
    """
    """
    started_packets = packet_out.search_similar_packets(outpacket)
    if started_packets:
        for active_packet, active_item in started_packets:
            if callbacks:
                for command, cb in callbacks.items():
                    active_packet.set_callback(command, cb)
            lg.warn(
                'skip creating new outbox packet because found similar packet: %r'
                % active_packet)
            return active_packet
    pkt_out = packet_out.create(outpacket, wide, callbacks, target, route,
                                response_timeout, keep_alive)
    # if _Debug and lg.is_debug(_DebugLevel):
    #     monitoring()
    control.request_update([('packet', outpacket.PacketID)])
    return pkt_out
예제 #2
0
def on_outbox_packet(outpacket, wide, callbacks, target=None, route=None):
    """
    """
    started_packets = packet_out.search_similar_packets(outpacket)
    if started_packets:
        for active_packet, active_item in started_packets:
            if callbacks:
                for command, cb in callbacks.items():
                    active_packet.set_callback(command, cb)
            return active_packet
    pkt_out = packet_out.create(outpacket, wide, callbacks, target, route)
    if _Debug and lg.is_debug(_DebugLevel):
        monitoring()
    control.request_update([('packet', outpacket.PacketID)])
    return pkt_out
예제 #3
0
def on_outbox_packet(outpacket, wide, callbacks, target=None, route=None):
    """
    
    """
    started_packets = packet_out.search_similar_packets(outpacket)
    if started_packets:
        for active_packet, active_item in started_packets:
            if callbacks:
                for command, cb in callbacks.items():
                    active_packet.set_callback(command, cb)
            return active_packet
    pkt_out = packet_out.create(outpacket, wide, callbacks, target, route)
    if _Debug and lg.is_debug(_DebugLevel):
        monitoring()
    control.request_update([("packet", outpacket.PacketID)])
    return pkt_out