Socket>>#waitForDataFor:ifClosed:ifTimedOut: large delay hangs process

squeakdev1 at squeakdev1 at
Tue Jan 15 18:54:29 UTC 2008

The trick is to come up with a robust implementation of
absoluteMillisecondClockValue. My previous idea, (Time
millisecondsSince:0) was wrong; it is equivalent to just (Time
millisecondClockValue). Maybe something like:


	| last next wrap |
        wrap := SmallInteger maxVal.  "is this correct?"
	last  := LastAbsoluteMillisecondClockValue ifNil:[0]. "class var"
	next := Time millisecondClockValue .
	[next  < last ] whileTrue:[ next := next + wrap].
        next < last ifTrue:[ next := last + (wrap - (last \\ wrap)) + next]."
	^LastAbsoluteMillisecondClockValue := next

> Maybe that's what should have been done in the first place, at least
> in part because it's so hard to debug such rarely-used code.
> Cheers!
> --Tom Phoenix

More information about the Squeak-dev mailing list