I am trying to asynchronously receive UDP commands from my other program. I am using the code below which works great, once. But if i resend the command, it doesn't receive it.

How do I continuously receive UDP packets?

vb.net Code:
  1. Private Sub startListening()
  2.         ReceivingUdpClient = New System.Net.Sockets.UdpClient(listenPort)
  3.         ThreadReceive = New System.Threading.Thread(AddressOf receiveMessages)
  4.         ThreadReceive.Start()
  5.     End Sub
  6.  
  7.     Private Sub receiveMessages()
  8.         Dim receiveBytes As [Byte]() = ReceivingUdpClient.Receive(RemoteIpEndPoint)
  9.         MsgBox(Encoding.ASCII.GetString(receiveBytes))
  10.         'the end goal is a Case but message box for debugging
  11.     End Sub