Sockets and Network Disconnect?
Sockets and Network Disconnect?
- Subject: Sockets and Network Disconnect?
- From: Karl Moskowski <email@hidden>
- Date: Thu, 31 Jul 2008 15:27:29 -0400
I'm writing a Leopard-only application that communicates with a server
using a custom protocol, basically sending & receiving a sequence of
TCP packets. I had tried using AsyncSocket, and it was great, but its
delegation-based approach made handling certain situations too
complex. I rewrote things to use SmallSockets in a NSOperation, and
it's been great. Now I'm trying to handle some errors, such as when
the network connection drops (e.g., cable disconnect, AirPort out of
range).
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. In each case, the result was a
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?
Thanks.
----
Karl Moskowski <email@hidden>
Voodoo Ergonomics Inc. <http://voodooergonomics.com/>
_______________________________________________
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