>From Socket class >> initializeNetwork:

        "Initialize the network drivers and the NetNameResolver. Do nothing if
the network is already initialized."
        "Note: The network must be re-initialized every time Squeak starts up,
so applications that persist across snapshots should be prepared to
re-initialize the network as needed. Such applications should call
'Socket initializeNetwork' before every network transaction. "

        NetNameResolver initializeNetwork

This explains why the initializeNetwork must be called *before* every
network transaction. Between image restarts the network isn't guaranteed
to remain.

I propose to create a new preference (I know that they are banned but we
need a workaround for 1.0 release) and then each user can, without
modify the NetNameResolver class >>initializeNetwork, change the setting
to the value that works for him/her.

First evaluate:

Preferences addPreference: #useOldNetwork categories:
#(general network)
    default: false balloonHelp: 'Enable/disable the use of the old
network code in making network connections. You need to save and restart
the image to this preference to take effect'
    projectLocal: false changeInformee: nil changeSelector: nil.

to create the preference in a PharoCore 10508 image.

Then load

Network-Kernel-MiguelCoba.22

from PharoInbox.

Pay attention that when you change the preference, it is not refected
immediately. You need to:

1. Open the image with the wrong value of the Preference
2. Change the preference
 Preferences enable: #useOldNetwork

  or

 Preferences disable: #useOldNetwork
3. Save the image
4. Restart the saved image
5. Evaluate:
NetNameResolver initializeNetwork

 or some way use the network (open a monticello browser for example, so
that initializeNetwork is called)

6. Test that the preference is being used:

NetNameResolver useOldNetwork -> value of preference

7. Test that resolves correctly an address:

NetNameResolver addressForName: 'www.yahoo.com' ->
209.131.36.158(f1.www.vip.sp1.yahoo.com),0(0)

8. Save the new image, now with the new preference.

I added this workaround as a fix to issue 1884 and changed status to
fixed.

Can you give it a try please and if so, generate a new image for
PharoCore?

Cheers
-- 
Miguel Cobá
http://miguel.leugim.com.mx


_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to