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

commits at source.squeak.org commits at source.squeak.org
Mon Sep 24 15:45:25 UTC 2012


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

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

Name: Network-dtl.137
Author: dtl
Time: 23 September 2012, 1:32:32.394 pm
UUID: b4bcd6e4-6a2d-4fc6-be4b-0d01accc3c72
Ancestors: Network-ul.136

Add a preference for "Enable IPv6 and new network support" in preference category "general". If enabled, IPv6 and the new network support will be enabled if the required primitives are present in the VM, otherwise the new network support is disabled regardless of whether the VM provides IPv6 primitives.

=============== Diff against Network-ul.136 ===============

Item was changed:
  Object subclass: #NetNameResolver
  	instanceVariableNames: ''
+ 	classVariableNames: 'DefaultHostName EnableIPv6 HaveNetwork ResolverBusy ResolverError ResolverMutex ResolverReady ResolverSemaphore ResolverUninitialized UseOldNetwork'
- 	classVariableNames: 'DefaultHostName HaveNetwork ResolverBusy ResolverError ResolverMutex ResolverReady ResolverSemaphore ResolverUninitialized UseOldNetwork'
  	poolDictionaries: ''
  	category: 'Network-Kernel'!
  
  !NetNameResolver commentStamp: '<historical>' prior: 0!
  This class implements TCP/IP style network name lookup and translation facilities.
  
  Attempt to keep track of whether there is a network available.
  HaveNetwork	true if last attempt to contact the network was successful.
  LastContact		Time of that contact (totalSeconds).
  haveNetwork	returns true, false, or #expired.  True means there was contact in the last 30 minutes.  False means contact failed or was false last time we asked.  Get out of false state by making contact with a server in some way (FileList or updates).!

Item was added:
+ ----- Method: NetNameResolver class>>enableIPv6 (in category 'system startup') -----
+ enableIPv6
+ 	<preference: 'Enable IPv6 and new network support'
+ 		category: 'general'
+ 		description: 'If true allow IPv6 support. If false, NetNameResolver useOldNetwork is set.'
+ 		type: #Boolean>
+ 	^EnableIPv6!

Item was added:
+ ----- Method: NetNameResolver class>>enableIPv6: (in category 'system startup') -----
+ enableIPv6: aBool
+ 	"Set a preference to control whether IPv6 primitives and new network support
+ 	should be used if available, and reinitialize the UseOldNetwork flag to recognize
+ 	the setting. If true, the new networking support will be used if the VM provides
+ 	the required primitives. If false, IPv6 and new network support will not be used.
+ 	The new network support may be unreliable on some platforms, so this preference
+ 	allows it to be explicitly disabled."
+ 
+ 	EnableIPv6 := aBool.
+ 	self initializeOldNetworkFlag
+ !

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 added:
+ ----- Method: NetNameResolver class>>initializeOldNetworkFlag (in category 'system startup') -----
+ initializeOldNetworkFlag
+ 
+ 	UseOldNetwork := self hasIpv6PrimSupport not or: [self enableIPv6 ~= true]!

Item was changed:
  ----- Method: NetNameResolver class>>startUp: (in category 'system startup') -----
  startUp: resuming
+ 	"Set the UseOldNetwork flag if ipv6 primitives are not present or if the EnableIPv6 preference is not set."
- 	"Set the UseOldNetwork flag if ipv6 primitives are not present"
  
+ 	resuming ifTrue: [self initializeOldNetworkFlag]!
- 	resuming ifTrue: [UseOldNetwork := self hasIpv6PrimSupport not]!



More information about the Squeak-dev mailing list