UDP server client

Posted on 2004-11-10
Last Modified: 2010-04-24
Hi i am new to and i am supposed to code a UDP server and client which just measures the RTT. I  really dont know where to this has to be broadcast server. And it has  2 or more clients .....
Can anyone post me some sample code to start ....
Question by:prashanth_gurijala
    LVL 5

    Accepted Solution

    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()
        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)
        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)
    End while

    Askme more if you need it.



    Author Comment

    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...

    Author Comment

    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..


    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now