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
ewomack2000
NA
22
0
C# UDP network stream...
Feb 18 2005 11:02 PM
Hello. Trying to write a program using UDP that reads from the network... I'm not using the UDPClient class (I probably should). I'm new to socket programming (and somewhat new to C#); all I need is to read the network stream, but the NetworkStream does not work with connectionless sockets (UDP); anyone know how I can do this? I've been searching the www with no luck so far. Here's my code so far (I X'd out the IP address and port to protect the innocent): using System; using System.Text; using System.Net; using System.Net.Sockets; namespace SocketTest { class Class1 { static void Main(string[] args) { IPAddress ia = IPAddress.Parse("XX.XXX.XXX.XXX"); IPEndPoint ie = new IPEndPoint(ia, XXXX); byte[] msg = Encoding.ASCII.GetBytes("1234stilltestingalot"); Socket ed = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); ed.SendTo(msg,ie); ed.Close(); } } } This program sends a message just fine, but I have to use a packet analyzer to read the server output. I'd like the server output to display in the console. Any help would be appreciated! Thank you!
Reply
Answers (
1
)
How to open a PASSWORD protected MS Access Database
Insert text in word document in overwirte mode.