I have seen this too (1.1.1), and it bothered me. I *think* you will find that the handles of the two sockets are the same, but it "Just ain't right" (TM).
Bill ________________________________________ From: [email protected] [[email protected]] On Behalf Of Sven Van Caekenberghe [[email protected]] Sent: Tuesday, July 12, 2011 7:38 AM To: An open mailing list to discuss any topics related to an open-source Smalltalk Subject: [Pharo-project] Socket objects created twice ? Hi All, I encountered something that I do not understand. I tried this in 1.2.2 and 1.4 with both my normal, older CogVM as well as the lastest one by Estaban. In a normal clean image, there would be not Socket instances. Socket allInstances size = 0 Now create any kind of Socket Socket new (or newTCP, newUDP) Now Socket allInstances size = 2 So Smalltalk reports two instances, but it seems they share the same socketHandle and semaphores, so one seems to be a shallow copy of the other. (Close the one instance, 3 timesRepeat: [ Smalltalk garbageCollect ] and they are both gone). Is this normal ? Is there really only one OS level socket ? Does this have to do with Sockets being in a WeakRegistry ? It is confusing to say the least. Sven
