[Pharo-project] Issue 1884: NetNameResolver doesn't work in PharoCore

Adrian Lienhard adi at netstyle.ch
Sun Feb 14 15:14:49 EST 2010


http://code.google.com/p/pharo/issues/detail?id=1884

This issue probably is the last obstacle for the 1.0 release. I've added the following comment:

---------

The preference proposed by Miguel does not solve the problem but puts the burden on the user that needs to change the preference depending on which implementation works for him. This will lead to many questions and frustrated users. If possible, I'd prefer to make the legacy IPv4 implementation work again until we have a proper IPv6 implementation.
 
The problem with printing "NetNameResolver addressForName: 'www.yahoo.com'" is not that the resolution does not work correctly but that the printOn: implementation of SocketAddress assumes an IPv6 address. I suggest to change the SocketAddress>>printOn: as follows. Maybe it's just this simple change to makes IPv4 work again -- maybe more such backward compatibility code is needed.

SocketAddress >>printOn: aStream
	NetNameResolver useOldNetwork ifTrue: [ ^ super printOn: aStream ].
	
	aStream
		nextPutAll: self hostNumber;
		nextPut: $(; nextPutAll: self hostName; nextPut: $);
		nextPut: $,;
		nextPutAll: self serviceNumber;
		nextPut: $(; nextPutAll: self serviceName; nextPut: $)

---------

This change makes #addressForName: work again with useOldNetwork set to true (as it is in recent PharoCore 1.0 images).

Could people that experience problems with the network code update this method and check out if other parts break?

Cheers,
Adrian

___________________
http://www.adrian-lienhard.ch/





More information about the Pharo-dev mailing list