[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Question regarding name lookups on the loopback dev

From: Paolo Bonzini
Subject: Re: [Help-smalltalk] Question regarding name lookups on the loopback device
Date: Wed, 09 Mar 2011 11:46:57 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

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/ b/packages/sockets/
index 6af7176..2370d40 100644
--- a/packages/sockets/
+++ b/packages/sockets/
@@ -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 [


reply via email to

[Prev in Thread] Current Thread [Next in Thread]