• 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: NSConnection, NSSocketPort, and timeouts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSConnection, NSSocketPort, and timeouts


  • Subject: Re: NSConnection, NSSocketPort, and timeouts
  • From: patrick machielse <email@hidden>
  • Date: Fri, 30 Mar 2007 01:46:22 +0200

Op 29-mrt-2007, om 21:01 heeft Jerry Krinock het volgende geschreven:

On 2007 Mar, 29, at 5:04, patrick machielse wrote:

Calling:

//  no effect
[connection setRequestTimeout:5.0];

doesn't make a difference, although I believe it should.

Probably you're not doing anything wrong. I noticed the same fixed 75 seconds with


   -[NSMutableURLRequest setTimeoutInterval]

and when I searched the list archives I found this to be quite a known issue, that this timeout is completely broken. Interesting that you've now found the same issue with NSConnection.

NSSocketPort may be the most interesting part. Seems as if this issue may have something to do with sockets. Oh well, yet another trip to the bug reporter.


The solution I used, to shorten the timeout, was to time it out with a separate NSTimer.

Hmm, not sure if that's practical for my situation. Maybe I can think of some other way.


I tried to set the timeout directly on the socket:

struct timeval timeout = (struct timeval) { 5, 0 };
int i = setsockopt([port socket], SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof timeout);


but it seems that the socket descriptor is -1 right up to the point where I call -[NSConnection rootProxy], and everything is set up lazily. Maybe if I create a socket first, set the timeout, create an NSSocketPort with it, etc., etc.

Boring!

patrick
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Core Image Advice needed
  • Next by Date: Re: NSNumberFormatter separator issue
  • Previous by thread: Re: NSConnection, NSSocketPort, and timeouts
  • Next by thread: QTMovie to handle NSData of an mp3?
  • Index(es):
    • Date
    • Thread