• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Sockets and Network Disconnect?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Sockets and Network Disconnect?
      • From: Jens Alfke <email@hidden>
    • Re: Sockets and Network Disconnect?
      • From: Josh Graessley <email@hidden>
  • Prev by Date: Dropped WoL packet
  • Next by Date: Re: Sockets and Network Disconnect?
  • Previous by thread: RE: Dropped WoL packet
  • Next by thread: Re: Sockets and Network Disconnect?
  • Index(es):
    • Date
    • Thread