TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
holy_bins
NA
7
0
Simple UDP socket...??
Jan 27 2005 2:09 PM
Just a quick question on sockets using UDP, not TCP... The code below is what I'm trying...I just want this simple console application to wait for some bytes...but it says that an "invalid argument" was supplied. I have all the right parameters in there, so I have no idea why it isn't accepting it...any help? Socket testSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); // UPD Socket IPEndPoint src = new IPEndPoint(IPAddress.Any, 0); // For source endpoint byte[] test = new Byte[1024]; // To store the received "message" EndPoint tempEP = (EndPoint)src; // Placeholder for the remote EP try { testSocket.ReceiveFrom(test, ref tempEP); // ...it just exceptions... } catch(Exception e){Console.WriteLine(e.ToString());}
Reply
Answers (
0
)
C# MySQL
Casting & Reflection