UDP server client

Hi i am new to VB.net and i am supposed to code a UDP server and client which just measures the RTT. I  really dont know where to start...as this has to be broadcast server. And it has  2 or more clients .....
Can anyone post me some sample code to start ....
thanx,
prashanth
prashanth_gurijalaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ignacio Soler GarciaSolution Architech & Technical LeadCommented:
What is the RTT? By the way, Im doing also a UDP Server, just start to play with this:

Imports System.Net
Imports System.Net.Sockets

Public Class ClassBootPServer
    Public Sub New()
        Listen(67)
    End Sub

    Private Sub Listen(ByVal vPort As Integer)
        Dim server As UdpClient
        Dim RemoteIpEndPoint As IPEndPoint
        Dim byteMessage As Byte()

        server = New UdpClient(vPort)
        RemoteIpEndPoint = New IPEndPoint(IPAddress.Any, 0)
        byteMessage = server.Receive(RemoteIpEndPoint)
        MsgBox(System.Text.ASCIIEncoding.ASCII.GetString(byteMessage)
    End Sub
End Class

This will read only one message. There are some ways to read endlessly:

a) With one thread that reads and stores the data in a buffer:
b) With a While true loop

While true
        byteMessage = server.Receive(RemoteIpEndPoint)
        MsgBox(System.Text.ASCIIEncoding.ASCII.GetString(byteMessage)
End while

Askme more if you need it.

SoMoS


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
prashanth_gurijalaAuthor Commented:
Thanx ... RTT is round trip time the time taken the packet to reach client and return back to server. i will check this out and reply back to you....
thanx for evrything...
--prashanth
0
prashanth_gurijalaAuthor Commented:
Hi thanx for your help. The problem is that i have one server and 3 clients( may be more depends) server sends packets and client echoes them back and server calculates the time taken by packet to go to client and reach back to server.

 and ony udp should be used as i will set broadcast option... later...

if u can direct me that would be lot more helpful....





This project will be integrated into a larger module for calulating signal strengths etc. Completed all but  got struck on this module...

thanx for your help..

--prashanth
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.