New code for UDP on client side. Should work but untested.