I need to emulate network latency using Ryu SDN controller. I first tried to add a sleep time after the decorator which calls a function everytime the controler receives a packet in message but the problem is this function is not able to treat the next packet in until the current is finished. Is there a way to make this function multithread?
@set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
def _packet_in_handler(self, ev):
time.sleep(LATENCY)
...