[squeak-dev] The Trunk: Network-fbs.140.mcz
Frank Shearar
frank.shearar at gmail.com
Sat Mar 2 18:40:10 UTC 2013
I reproduce it typically by not having a network connection!
OK, so the solution is more complicated: NetNameResolver >>
#addressForName:timeout: must have a way of signalling not only a name
lookup failure (which loops via the exception's defaultAction) but
also a name lookup failure where the user gives up. Given the return
values, how about
result := NetNameResolver addressForName: 'foo' timeout: 20.
(NetNameResolver useOldNetwork and: [result = #[0 0 0 0]])
ifTrue: ["Signal failure"].
(NetNameResolver useOldNetwork not and: [result isNil])
ifTrue: ["Signal failure"].
?
frank
On 2 March 2013 16:02, David T. Lewis <lewis at mail.msen.com> wrote:
> I am not sure how to reproduce the original problem (on Linux), but I'm
> not sure if the proposed fix will work if the IPv6 networking is disabled
> in preferences. The resolver behaves differently depending on whether the
> new network primitives are being used, and may answer #[0 0 0 0] rather
> than nil.
>
> NetNameResolver useOldNetwork: true.
> NetNameResolver addressForName: 'foo' timeout: 20 ==> #[0 0 0 0]
>
> NetNameResolver useOldNetwork: false.
> NetNameResolver addressForName: 'foo' timeout: 20 ==> nil
>
> Dave
>
> On Fri, Mar 01, 2013 at 10:39:44AM +0000, commits at source.squeak.org wrote:
>> Frank Shearar uploaded a new version of Network to project The Trunk:
>> http://source.squeak.org/trunk/Network-fbs.140.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Network-fbs.140
>> Author: fbs
>> Time: 1 March 2013, 10:39:25.076 am
>> UUID: 9f6d4989-84fc-4303-87ab-406d2296fd73
>> Ancestors: Network-fbs.139
>>
>> If the user gives up on trying to resolve a name, fail the socket connect completely.
>>
>> http://bugs.squeak.org/view.php?id=4025.
>>
>> =============== Diff against Network-fbs.139 ===============
>>
>> Item was changed:
>> ----- Method: SocketStream class>>openConnectionToHostNamed:port: (in category 'instance creation') -----
>> openConnectionToHostNamed: hostName port: portNumber
>> | hostIP |
>> hostIP := NetNameResolver addressForName: hostName timeout: 20.
>> + hostIP ifNil: [NetworkError signal: ('Cannot resolve {1}.' format: {hostName})].
>> ^self openConnectionToHost: hostIP port: portNumber!
>
More information about the Squeak-dev
mailing list
|