Thread: block until certain event happen

  1. #1
    Registered User
    Join Date
    Dec 2016
    Posts
    7

    block until certain event happen

    is there anyway to block/wait until certain event happen before move to next function for example

    while
    1 wait for ethrnet packet, only move to 2 when receive a Ethernet message or some kind wait event
    2. do something

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Well ordinarily, a recv() on a socket is blocking to begin with, so what's the problem?

    You keep calling recv() until you get your 'go to next step' message.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 06-06-2011, 08:23 AM
  2. Intercept mouse event and change to different event
    By ByThaBay in forum Windows Programming
    Replies: 1
    Last Post: 03-19-2008, 05:44 PM
  3. Hey, what would happen if...
    By Imperito in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 04-05-2002, 08:54 AM
  4. What would happen?
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 04-04-2002, 10:54 AM
  5. how the f*c* can something like this happen
    By iain in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 01-30-2002, 09:33 PM

Tags for this Thread