[squeak-dev] The Trunk: Network-dtl.138.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Dec 18 23:47:27 UTC 2012


David T. Lewis uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-dtl.138.mcz

==================== Summary ====================

Name: Network-dtl.138
Author: dtl
Time: 18 December 2012, 6:47:06.058 pm
UUID: b07fa296-83d5-4868-b139-40e1f4150c5b
Ancestors: Network-dtl.137

Ensure that the Enable IPv6 preference is honoured when initializing NetNameResolver, and document the intent of #initializeOldNetworkFlag.

=============== Diff against Network-dtl.137 ===============

Item was changed:
  ----- Method: NetNameResolver class>>initialize (in category 'class initialization') -----
  initialize
  	"NetNameResolver initialize"
  	"Note: On the Mac, the name resolver is asynchronous (i.e., Squeak can do other things while it is working), but can only handle one request at a time. On other platforms, such as Unix, the resolver is synchronous; a call to, say, the name lookup primitive will block all Squeak processes until it returns."
  
  	"Resolver Status Values"
  	ResolverUninitialized := 0.	"network is not initialized"
  	ResolverReady := 1.			"resolver idle, last request succeeded"
  	ResolverBusy := 2.			"lookup in progress"
  	ResolverError := 3.			"resolver idle, last request failed"
  
  	DefaultHostName := ''.
  
- 	UseOldNetwork := self hasIpv6PrimSupport not.
  	self enableIPv6: true. "Initialize preference to permit use of new networking"
  	Smalltalk addToStartUpList: self.
  
  !

Item was changed:
  ----- Method: NetNameResolver class>>initializeNetwork (in category 'network initialization') -----
  initializeNetwork
  	"Initialize the network drivers and record the semaphore to be used by the resolver. Do nothing if the network is already initialized. Evaluate the given block if network initialization fails."
  	"NetNameResolver initializeNetwork" 
  
  	| semaIndex |
  	self resolverStatus = ResolverUninitialized
  		ifFalse: [^HaveNetwork := true].  "network is already initialized"
  
  	HaveNetwork := false.	"in case abort"
  	ResolverSemaphore := Semaphore new.
  	semaIndex := Smalltalk registerExternalObject: ResolverSemaphore.
  
  	"result is nil if network initialization failed, self if it succeeds"
  	(self primInitializeNetwork: semaIndex)
  		ifNil: [NoNetworkError signal: 'failed network initialization']
  		ifNotNil: [HaveNetwork := true].
  
+ 	self initializeOldNetworkFlag
- 	UseOldNetwork := [NetNameResolver primHostNameSize. false]
- 		on: Error
- 		do: [:ex | ex return: true]
  !

Item was changed:
  ----- Method: NetNameResolver class>>initializeOldNetworkFlag (in category 'system startup') -----
  initializeOldNetworkFlag
+ 	"If the VM does not provide support for IPv6 primitives, or if the enable IPv6
+ 	preference is not selected, then set a flag to force use of traditional IPv4
+ 	network support. This limits network support to IPv4 and uses a four-element
+ 	ByteArray rather than SocketAddress to represent network addresses."
  
  	UseOldNetwork := self hasIpv6PrimSupport not or: [self enableIPv6 ~= true]!



More information about the Squeak-dev mailing list