The Trunk: Network-topa.205.mcz

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

The Trunk: Network-topa.205.mcz

commits-2
Tobias Pape uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-topa.205.mcz

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

Name: Network-topa.205
Author: topa
Time: 18 September 2017, 4:38:54.251829 pm
UUID: 78da25ea-86bd-42ff-8979-5d33af450b2e
Ancestors: Network-pre.204

Make use of IPv6 in SocketStreams unless old networking is requested.

=============== Diff against Network-pre.204 ===============

Item was changed:
  ----- Method: SocketStream class>>openConnectionToHostNamed:port: (in category 'instance creation') -----
  openConnectionToHostNamed: hostName port: portNumber
+
+ NetNameResolver useOldNetwork
+ ifTrue: [ | hostIP |
+ hostIP := NetNameResolver addressForName: hostName timeout: 20.
+ hostIP ifNil: [NetworkError signal: ('Cannot resolve {1}.' format: {hostName})].
+ ^self openConnectionToHost: hostIP port: portNumber]
+ ifFalse: [| addressInformations lastError |
+ addressInformations := SocketAddressInformation
+ forHost: hostName
+ service: portNumber asString
+ flags: 0
+ addressFamily: 0
+ socketType: SocketAddressInformation socketTypeStream
+ protocol: SocketAddressInformation protocolTCP.
+ addressInformations do: [:addressInformation |
+ [^ self on: addressInformation connect] on: NetworkError do: [:e | lastError := e]].
+ ^ lastError ifNotNil: [:e | e pass]]!
- | hostIP |
- hostIP := NetNameResolver addressForName: hostName timeout: 20.
- hostIP ifNil: [NetworkError signal: ('Cannot resolve {1}.' format: {hostName})].
- ^self openConnectionToHost: hostIP port: portNumber!