Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / December 2003

Tip: Looking for answers? Try searching our database.

UDP problems...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lloyd Dupont - 15 Dec 2003 00:48 GMT
I tery to write a very simple UDP listening server.
the code goes like this:

UdpClient udp = new UdpClient();
IPEndPoint rip = new IPEndPoint(IPAddress.Any, 0);
byte[] msg = udp.Receive(ref rip);

when I run it I have the following exception:
Unhandled Exception: System.Net.Sockets.SocketException: An invalid argument
was supplied
  at System.Net.Sockets.Socket.ReceiveFrom(Byte[] buffer, Int32 offset,
Int32 size, SocketFlags socketFlags, EndPoint& remoteEP)
  at System.Net.Sockets.UdpClient.Receive(IPEndPoint& remoteEP)

what that could be ?
Feroze [MSFT] - 18 Dec 2003 00:13 GMT
You need to bind the local endpoint first. You can do it by creating
UdpClient with a port ( new UdpClient(int port))

Signature

Remove "user" from the email address to reply to the author.

This posting is provided "AS IS" with no warranties, and confers no rights

Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> I tery to write a very simple UDP listening server.
> the code goes like this:
[quoted text clipped - 11 lines]
>
> what that could be ?
Lloyd Dupont - 18 Dec 2003 10:20 GMT
thanks !
I had found it ;-)

> You need to bind the local endpoint first. You can do it by creating
> UdpClient with a port ( new UdpClient(int port))
[quoted text clipped - 15 lines]
> >
> > what that could be ?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.