you said program hangs while receive that may because at that data not avail and second option you may try with change IPEndPoint remoteIpEndPoint = new IPEndPoint(ip, 1000); to
IPEndPoint...