• 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: CLOSE_WAIT with CFHTTPMessage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CLOSE_WAIT with CFHTTPMessage


  • Subject: Re: CLOSE_WAIT with CFHTTPMessage
  • From: Mark Pauley <email@hidden>
  • Date: Thu, 24 Jun 2010 11:37:11 -0700

What version of the OS are you running?  I'm guessing that you're not setting the Connection: Close header and / or you're setting the keep-alive property on the connection, correct?

In general: to use connection keep alive with HTTP Read Streams, you have to overlap open's and close's.  This means that you can unschedule and set the client to NULL, but you can't call CFReadStreamClose until you open the next read stream.  Keep the previous read stream in an instance variable or something and close it after you open the next request.  Of course when you want to actually kill the underlying connection, you can call CFReadStreamClose before opening the next stream.
Using keepalive should be a huge performance win for you as well.

Apart from that, if you can prove that you're actually calling CFReadStreamClose and we aren't closing your socket, and you see the socket in CLOSE_WAIT via 'netstat -p tcp', it would appear you've also hit a bug.

PS:
What are you really passing to CFSocketInvalidate? The signature is:

void CFSocketInvalidate (
   CFSocketRef s
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: CLOSE_WAIT with CFHTTPMessage
      • From: Greg Hulands <email@hidden>
References: 
 >CLOSE_WAIT with CFHTTPMessage (From: Greg Hulands <email@hidden>)

  • Prev by Date: CLOSE_WAIT with CFHTTPMessage
  • Next by Date: Re: CLOSE_WAIT with CFHTTPMessage
  • Previous by thread: CLOSE_WAIT with CFHTTPMessage
  • Next by thread: Re: CLOSE_WAIT with CFHTTPMessage
  • Index(es):
    • Date
    • Thread