I'm having trouble getting the UDPClient to work with VB.NET (I havn't tried in C# or C/C++).
The udpClient has connected and sent a signal to 127.0.0.1 on port 11000 with no exceptions thrown. On the below line of code,
Dim receiveBytes As [Byte]() = udpClient.Receive(RemoteIpEndPoint)
I receive the below exception error,
System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.ReceiveFrom(Byte buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint& remoteEP)
at System.Net.Sockets.Socket.ReceiveFrom(Byte buffer, Int32 size, SocketFlags socketFlags, EndPoint& remoteEP)
at System.Net.Sockets.UdpClient.Receive(IPEndPoint& remoteEP)
at WindowsApplication4.Form1.Button1_Click(Object sender, EventArgs eClick) in C:\Documents and Settings\ellisb\My Documents\Visual Studio Projects\WindowsApplication4\Form1.vb:line 132
RemoteIPEndPoint is defined using the following line of code,
Dim RemoteIpEndPoint As New IPEndPoint(IPAddress.Any, 0)
Any ideas why it throws the exception and how to solve it?
Cheers in advance.