Fix issue where program doesn't work when connecting from a different host

This issue is caused because only the data in the DatagramPacket is changed,
but the destination remains the same. This is also why it works within the
localhost, but fails when connecting from a different host.