Re: Sockets and Network Disconnect?
Re: Sockets and Network Disconnect?
- Subject: Re: Sockets and Network Disconnect?
- From: Jens Alfke <email@hidden>
- Date: Thu, 31 Jul 2008 13:30:15 -0700
On 31 Jul '08, at 12:27 PM, Karl Moskowski wrote:
SmallSockets seems to hang on send() & recv() without an error.
After Googling around, I tried a couple of approaches to test
network reachability first - SCNetworkCheckReachabilityByAddress()
and CFNetDiagnosticCopyNetworkStatusPassively() - but neither seemed
to work.
...
Is there a way to get SmallSockets to time-out or throw some sort of
error in such a situation? If not, is there another synchronous
socket class?
I'm not familiar with SmallSockets, but there are general-purpose
techniques to implement timeouts or other disconnects when using POSIX
socket APIs, usually involving using an alarm or signal. Stevens et
al's "Unix Network Programming" covers these. (I can't give you
details, because I don't code this way; I use the async APIs provided
by CFNetwork and Foundation.)
—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden