Hi Holger,
sorry for the late reply.
On 03/06/2011 01:59 PM, Holger Hans Peter Freyther wrote:
> should SocketAddress byName: (SocketAddress loopbackHost) equal to
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You mean 'localhost' or "SocketAddress localHostName" here.
> SocketAddress loopbackHost?
It isn't, but it is a plausible requirement.
Right now, #byName: is returning a random address, but preferring one
for the default address class is a good idea.
Does this patch satisfy your needs?
diff --git a/packages/sockets/SocketAddress.st
b/packages/sockets/SocketAddress.st
index 6af7176..2370d40 100644
--- a/packages/sockets/SocketAddress.st
+++ b/packages/sockets/SocketAddress.st
@@ -277,7 +277,8 @@ and vice versa.'>
aString isEmpty ifTrue: [^self loopbackHost].
all := self allByName: aString.
all isNil ifTrue: [^nil].
- ^all anyOne
+ ^all detect: [:each | each isKindOf: Socket defaultAddressClass]
+ ifNone: [all anyOne]
]
SocketAddress class >> extractAddressesAfterLookup: aiHead [
Paolo
_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk