I am working on a program that sends ARP requests, it basically asks all the ip's on a network what their mac adress is. So i need the program to wait for 100 miliseconds for a response, otherwise ask the next mac adress what its mac is.
Asked
Active
Viewed 70 times
0
-
dup http://stackoverflow.com/questions/2566073/how-to-make-c-program-wait-on-linux – hit May 12 '13 at 01:36
-
Search engine is your good friend. – prehistoricpenguin May 12 '13 at 01:44
-
@AdamLiss it does not answer my question, i do not want it to sleep because if it sleeps, i will not listen to the ARP response (the device's mac adress), i am trying the select() function but i am not sure on how it works. – blidt May 12 '13 at 01:45
-
@ÁngelCáceresLicona So you may use another thread to watch events. – prehistoricpenguin May 12 '13 at 01:46
-
http://stackoverflow.com/search?q=use+select+to+wait – Adam Liss May 12 '13 at 01:51
-
@prehistoricpenguin something like that, i have no idea how to do it on c or i do not undersatnd the select() function. – blidt May 12 '13 at 01:52
-
@AdamLiss it seems like i did not do enough research, thanks a lot. – blidt May 12 '13 at 02:04
-
while your program is sleeping, your computer will continue to get the network data. You won't be able to process it until you're done sleeping, but you won't lose the data while you're sleeping. – xaxxon May 12 '13 at 06:25
-
Use a multiplexing syscall like [poll(2)](http://man7.org/linux/man-pages/man2/poll.2.html) – Basile Starynkevitch May 12 '13 at 06:59