I would make uid_ip_table a member of UdpServer class instead of global. I try to avoid global variables as much as possible.