Thread: need technical help regarding multicasting

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    22

    need technical help regarding multicasting

    Hi Gurus,
    This is my first thread here.

    I m developing p2p multicasting subtrate which is intended to multicast a query string and wait for a response from its groups nodes.

    here i need to wait for some time (eg 5 seconds ) for a response after i multicast the message and print the response. how can i implement this? i know this is simple but as im new to C i hv no idea how to do this.

    here is my code fragment
    Code:
     
      // some code here
        if(fork())
        {
                while(1){
                  new_mcast_recieve( host ,port );
                  // todo here how can i wait for 5 seconds for a response. if not exit from the loop
               }
        }
       mcast_send(mc , query , sizeof(query));      
    
      //.some code here
    if you hv a better structure about how to implemet this please sugest me.

    thanks you.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    There are platform-specific Sleep methods. Windows have Sleep, Linux have sleep.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. multicasting - need a help on multicasting
    By wwwnuwan in forum Networking/Device Communication
    Replies: 4
    Last Post: 03-27-2009, 05:16 PM
  2. [JOB] C++ Technical Director/Senior Developer, London, UK
    By Nick1 in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 12-10-2008, 05:18 AM
  3. Technical Specialist - Update Delivery - C Required
    By ISCRecruiter in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 07-21-2008, 09:50 AM
  4. Question about going to a technical school
    By Goalie35 in forum C++ Programming
    Replies: 1
    Last Post: 08-30-2001, 11:34 AM