• 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: Strange Webview Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange Webview Problem


  • Subject: Re: Strange Webview Problem
  • From: "Diez B. Roggisch" <email@hidden>
  • Date: Wed, 14 Jan 2009 00:48:24 +0100

Jean-Daniel Dupas schrieb:

Le 14 janv. 09 à 00:11, Diez B. Roggisch a écrit :

Nick Zitzmann schrieb:
On Jan 13, 2009, at 3:45 PM, Diez B. Roggisch wrote:
Just for the record - the timoutInterval of 0 is the culprit. I don't have the slightest idea why it stopped working, but I don't care either. It might be worth mentioning in the docs though that passing 0 actually terminates the request immediatly, instead of setting the timeout to unlimited.
That makes sense, actually. If you want the timeout interval to be unlimited, then you should pass in DBL_MAX, which will cause it to time out ~300 million years from now, by which point I assume your computer will no longer be around (or at least you won't be using it)... 0 usually means "do it now" when it comes to time intervals.

But it doesn't mean "do it now", it means "don't do it at all"...

And I disagree that it makes sense - if I didn't want something to happen, I simply wouldn't make the call.

It obviously meant "I don't care" until a few months ago, and I've seen lots of interfaces that behaved that way. Timeouts, resource limits, all those kind of things accept 0 for "turn this option off."

However, it was never documented to work that way, so I don't blame anybody - it's obviously an implementation artifact. And of course I can (and did) set the timout to a ridiculous long interval. Not just as long as you proposed though :)

Diez

Just an example of why 0 does not always mean "no timeout":

I never said it always does.

man poll
If timeout is greater than zero, it specifies a maximum interval (in milliseconds) to wait for any file descriptor to become ready.
If timeout is zero, then poll() will return without blocking. If the value of timeout is -1, the poll blocks indefinitely.


Else how would you handle this case ?


I wouldn't. Because there are three different semantics of poll that need to be catered to.

See here for an example that shaped my expectations:

https://twiki.cern.ch/twiki/bin/view/LCG/FtsChangesFrom20To21

"""
Note on timeout arguments: values for timeout arguments in the database follow this convention:


* unset (null) or negative value: do not specify the timeout and let the underlying transfer service choose a default.
* 0: no timeout (if the underlying transfer service allows it; e.g. in case of http timeout, a timeout is always set).
* positive value: use value for timeout
"""


I don't say passing 0 as timeout *has* to behave the way I expected it to be. All I say is

- the behavior changed without notice, so it is some kind of regression
- it is not documented
- there are known cases where 0 means "ignore value", so it is worth documenting
- I fail to see where the sense lies in making a call effectively a NOP


However, I don't want to blow this out of proportion. My problem is solved.

The fun part would have been if I had received these insights into the meaning of timeout *before* I struggled to find make things work. Which is not to imply you guys aren't helpful.

Diez
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


References: 
 >Strange Webview Problem (From: "Diez B. Roggisch" <email@hidden>)
 >Re: Strange Webview Problem (From: "Diez B. Roggisch" <email@hidden>)
 >Re: Strange Webview Problem (From: Nick Zitzmann <email@hidden>)
 >Re: Strange Webview Problem (From: "Diez B. Roggisch" <email@hidden>)
 >Re: Strange Webview Problem (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Killall Finder Brings Hidden Apps To Front?
  • Next by Date: Re: Killall Finder Brings Hidden Apps To Front?
  • Previous by thread: Re: Strange Webview Problem
  • Next by thread: Re: Strange Webview Problem
  • Index(es):
    • Date
    • Thread