moved udp code to networking.c