Squeak Socket Primitives (with Correspondents fix)
Lex Spoon
lex at cc.gatech.edu
Mon Nov 15 12:03:34 UTC 1999
Craig Latta <Craig.Latta at NetJam.ORG> wrote:
>
> > "Server accepting single connection (using Squeak prims)"
> > Socket initializeNetwork.
> > server _ Socket newTCP.
> > server listenOn: 22334.
> ***
>
> client _ Socket newTCP.
> client
> connectTo: (NetNameResolver addressForName: 'localhost')
> port: 22334.
> client sendData: (String new: 100000)
>
> ***
>
> I evaluated the whole thing without incident; great. Then I evaluated
the last line again. Control did not return to the UI Smalltalk process.
I hit alt-period, and noticed that the second writing attempt was stuck
in a loop with all 100,000 bytes left to send.
>
To clarify, this loop is not a busy loop. It is more like:
[ socket spaceAvailable ] whileFalse: [
semaphore wait ]
Isn't this the desired behavior? In fact, I just tried it, and Squeak
dropped off the bottom of a "top" listing while it was waiting--this
means it took 0.0% CPU when you round it off.
Lex
More information about the Squeak-dev
mailing list
|