Hack to test recvfrom in the main thread