Re: retrieve a milliseconds interval with obj-C
Re: retrieve a milliseconds interval with obj-C
- Subject: Re: retrieve a milliseconds interval with obj-C
- From: Shawn Erickson <email@hidden>
- Date: Fri, 25 Nov 2005 07:55:47 -0800
On Nov 25, 2005, at 7:40 AM, Andrea Salomoni wrote:
Hi and thank you,
the problem is simple : I need to check a socket connection with
that while so:
if (10 seconds are passed)
{
return an error and exit;
}
else
{
continue
}
How can I do?
It is bests not to poll the socket ("check it every ten seconds") but
either block a thread waiting for data to come in on the socket or
setup so you get a callback / event when the socket has data available.
If you are working in Cocoa I suggest you look at Cocoa's network
support or consider using CFSocket and connect it up with your runloop.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden