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