Made main loop Async. Packet sending is thread safe