[squeak-dev] The Inbox: Network-dtl.126.mcz

David T. Lewis lewis at mail.msen.com
Wed Jun 6 14:32:26 UTC 2012


I'm not entirely sure if this is consistent with the original intent of
the UseOldNetwork flag in NetNameResolver, but in any case it seems to
provide a workable solution that should behave reasonably for VMs that
do not have the ipv6 network primitives. The approach taken here is that
NetNameResolver sets the flag at #startup time, and the network unit
tests are expected to give the same results regardless of VM.

Currently there are no specific unit tests for the ipv6 functionality,
so we should come up with some new tests for this at some point too.

I have only tested this on Linux, and it seems like we may be getting
different test results on OS X, so any additional testing on Mac and/or
Windows would be helpful.

Dave


On Wed, Jun 06, 2012 at 12:07:38PM +0000, commits at source.squeak.org wrote:
> A new version of Network was added to project The Inbox:
> http://source.squeak.org/inbox/Network-dtl.126.mcz
> 
> ==================== Summary ====================
> 
> Name: Network-dtl.126
> Author: dtl
> Time: 6 June 2012, 8:07:34.782 am
> UUID: f6ad35b2-fac8-4cc8-8ca8-1742bd941685
> Ancestors: Network-dtl.125
> 
> Set the UseOldNetwork flag at image startup if ipv6 primitives are not present in the VM.
> 
> =============== Diff against Network-dtl.125 ===============
> 
> Item was added:
> + ----- Method: NetNameResolver class>>hasIpv6PrimSupport (in category 'system startup') -----
> + hasIpv6PrimSupport
> + 	"True if the VM includes the ipv6 primitives"
> + 	^[NetNameResolver primHostNameSize. true]
> + 		on: Error
> + 		do: [false]
> + !
> 
> 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.
> + 	Smalltalk addToStartUpList: self.
> + 
>   !
> 
> Item was added:
> + ----- Method: NetNameResolver class>>startUp: (in category 'system startup') -----
> + startUp: resuming
> + 	"Set the UseOldNetwork flag if ipv6 primitives are not present"
> + 
> + 	resuming ifTrue: [UseOldNetwork := self hasIpv6PrimSupport not]!
> 


More information about the Squeak-dev mailing list