[RESOLVED] UDPClient error
Hi, first time poster
I went on MSDN and looked at their example for receiving UDPs.
WHen I use it, it gives me an error. Here is my code:
I get error on * * line. It says:
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.dll
Additional information: An invalid argument was supplied
I even tryed copying the code directly from MSDN into a console app, didn't work.
Why won't it work?
Thank you
Hi, first time poster
I went on MSDN and looked at their example for receiving UDPs.
WHen I use it, it gives me an error. Here is my code:
VB.NET:
Private Sub Receive_UDP_Message(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnListen.Click
Dim udpReceive As New System.Net.Sockets.UdpClient
Dim receiveBytes As Byte()
Dim RemoteIpEndPoint As New IPEndPoint(IPAddress.Any, 0)
* * receiveBytes = udpReceive.Receive(RemoteIpEndPoint)
Dim returnData As String = Encoding.ASCII.GetString(receiveBytes)
DisplayText(("This is the message you received " + returnData.ToString()))
End Sub
I get error on * * line. It says:
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.dll
Additional information: An invalid argument was supplied
I even tryed copying the code directly from MSDN into a console app, didn't work.
Why won't it work?
Thank you
Last edited: