David T. Lewis uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-bf.124.mcz==================== Summary ====================
Name: Network-bf.124
Author: bf
Time: 5 June 2012, 3:06:54.188 pm
UUID: 74d59e26-aff4-40c0-a032-4b5bba3eed9a
Ancestors: Network-dtl.123
Do not use asSocketAddress in the old network code.
=============== Diff against Network-dtl.123 ===============
Item was changed:
----- Method: NetNameResolver class>>addressForName:timeout: (in category 'lookups') -----
addressForName: hostName timeout: secs
"Look up the given host name and return its address. Return nil if the address is not found in the given number of seconds."
"NetNameResolver addressForName: 'create.ucsb.edu' timeout: 30"
"NetNameResolver addressForName: '100000jobs.de' timeout: 30"
"NetNameResolver addressForName: '1.7.6.4' timeout: 30"
"NetNameResolver addressForName: '' timeout: 30 (This seems to return nil?)"
| deadline result |
self initializeNetwork.
self useOldNetwork
ifFalse: [^self addressForName: hostName].
"check if this is a valid numeric host address (e.g. 1.2.3.4)"
result := self addressFromString: hostName.
+ result isNil ifFalse: [^result].
- result isNil ifFalse: [^result asSocketAddress].
"Look up a host name, including ones that start with a digit (e.g. 100000jobs.de or squeak.org)"
deadline := Time millisecondClockValue + (secs * 1000).
"Protect the execution of this block, as the ResolverSemaphore is used for both parts of the transaction."
self resolverMutex
critical: [
(self waitForResolverReadyUntil: deadline)
ifTrue: [
self primStartLookupOfName: hostName.
(self waitForCompletionUntil: deadline)
ifTrue: [result := self primNameLookupResult]
ifFalse: [(NameLookupFailure hostName: hostName) signal: 'Could not resolve the server named: ', hostName]]
ifFalse: [(NameLookupFailure hostName: hostName) signal: 'Could not resolve the server named: ', hostName]].
+ ^result!
- ^result asSocketAddress!