Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

namanhams

macrumors regular
Original poster
Jun 3, 2009
153
0
I have some code like this :
Code:
After every time interval INTERVAL :
- Create a socket, set its callback method, and send PING message to this socket.

Actually my code is the modified version of SimplePing (http://developer.apple.com/library/mac/#samplecode/SimplePing/Introduction/Intro.html

The weird thing is :
- If INTERVAL is big number (Eg, 0.5s), then everything works fine. The callback is called for every packet that is sent.
- If INTERVAl is small (Eg, 0.02s), then the callback is always called for the first 50 packets. Callback is not called for all later packets.

I'm not sure but i think there's something special about this number "50". I've run this app many times and it's always the same.
 

namanhams

macrumors regular
Original poster
Jun 3, 2009
153
0
Hi,

Thanks for your reply.

You can download the source code here. Currently, in main.c, the timer is fired every 1 second. Just change it to 0.2 second. You will see that : from the 49th ping, all pings are sent but there's no reply from server.
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
you said, you can download the source code, but i don't see anything neither ^_-
and people mostly don't just random download code, maybe try find more specific code, and post that here under [ code] tags please =)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.