• 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
Re: socket “read” hanging if the MacBook sleeps more than 10 minutes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: socket “read” hanging if the MacBook sleeps more than 10 minutes


  • Subject: Re: socket “read” hanging if the MacBook sleeps more than 10 minutes
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 5 Nov 2009 11:05:23 -0800


On Nov 5, 2009, at 6:09 AM, Sabyasachi Ruj wrote:

Now, while the app is downloading, if I put the MacBook in sleep mode
for more than 10 minutes, 60% of the time the app hangs when the
computer wakes up.
...
Also, this is not just TCP/IP waiting that will come out in few
minutes. I have waited for more than 12 hours, it did not come out.

I'm not a TCP expert, but I think this is normal. If the sleep occurs while the socket doesn't have any packets to send, or to send ACKs for, then on wake it'll just be waiting for incoming packets that will never arrive (because the server's already timed out and closed the socket.) And TCP doesn't have any timeouts for idle sockets.


If what I'm saying is true, and you want to avoid this, you should probably set a timeout on your read. And/or detect system sleep and close the socket then (which is what apps like Mail and iChat do.)

—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


References: 
 >socket “read” hanging if the MacBook sleeps more than 10 minutes (From: Sabyasachi Ruj <email@hidden>)

  • Prev by Date: socket “read” hanging if the MacBook sleeps more than 10 minutes
  • Next by Date: How can I get information of network disconnection
  • Previous by thread: socket “read” hanging if the MacBook sleeps more than 10 minutes
  • Next by thread: How can I get information of network disconnection
  • Index(es):
    • Date
    • Thread