The Trunk: Network-dtl.134.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Network-dtl.134.mcz

commits-2
David T. Lewis uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-dtl.134.mcz

==================== Summary ====================

Name: Network-dtl.134
Author: dtl
Time: 15 August 2012, 8:25:27.537 am
UUID: 04d48605-71ff-4afa-b61a-a749a603a2af
Ancestors: Network-ul.133

Fix for SocketTest>>testPeerName
Use #remoteAddress instead of #remoteSocketAddress in Socket>>peerName.

Follow up required: Implementation of remoteSocketAddress may be wrong, and is presumably redundant with socketAddress. The tests in NetNameResolver class>>testIPv6 should be converted to unit tests.

=============== Diff against Network-ul.133 ===============

Item was changed:
  ----- Method: Socket>>peerName (in category 'accessing') -----
  peerName
  "Return the name of the host I'm connected to, or nil if its name isn't known to the domain name server or the request times out."
  "Note: Slow. Calls the domain name server, taking up to 20 seconds to time out. Even when sucessful, delays of up to 13 seconds have been observed during periods of high network load."
 
  ^NetNameResolver useOldNetwork
+ ifFalse: [ self remoteAddress hostName ]
- ifFalse: [ self remoteSocketAddress hostName ]
  ifTrue: [ NetNameResolver
  nameForAddress: self remoteAddress
  timeout: 20 ]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Network-dtl.134.mcz

Levente Uzonyi-2
On Wed, 15 Aug 2012, [hidden email] wrote:

> David T. Lewis uploaded a new version of Network to project The Trunk:
> http://source.squeak.org/trunk/Network-dtl.134.mcz
>
> ==================== Summary ====================
>
> Name: Network-dtl.134
> Author: dtl
> Time: 15 August 2012, 8:25:27.537 am
> UUID: 04d48605-71ff-4afa-b61a-a749a603a2af
> Ancestors: Network-ul.133
>
> Fix for SocketTest>>testPeerName
> Use #remoteAddress instead of #remoteSocketAddress in Socket>>peerName.
>
> Follow up required: Implementation of remoteSocketAddress may be wrong, and is presumably redundant with socketAddress. The tests in NetNameResolver class>>testIPv6 should be converted to unit tests.

Right, #remoteSocketAddress shouldn't send #asSocketAddress to the result
of the primitive if #useOldNetwork is true. I'm not sure if the
implementation is right if #useOldNetwork is false, but it's unlikely
since the error came from that branch, but it might also be a bug in the
primitives.

While #remoteAddress and #remoteSocketAddress are similar, #remoteAddress
will always return an IPv4 address (unless the implementation of
primitiveSocketRemoteAddress changed), so I think both methods have some
value.


Levente

>
> =============== Diff against Network-ul.133 ===============
>
> Item was changed:
>  ----- Method: Socket>>peerName (in category 'accessing') -----
>  peerName
>   "Return the name of the host I'm connected to, or nil if its name isn't known to the domain name server or the request times out."
>   "Note: Slow. Calls the domain name server, taking up to 20 seconds to time out. Even when sucessful, delays of up to 13 seconds have been observed during periods of high network load."
>
>   ^NetNameResolver useOldNetwork
> + ifFalse: [ self remoteAddress hostName ]
> - ifFalse: [ self remoteSocketAddress hostName ]
>   ifTrue: [ NetNameResolver
>   nameForAddress: self remoteAddress
>   timeout: 20 ]!
>
>
>