Squeak Socket Primitives

Raab, Andreas Andreas.Raab at disney.com
Thu Nov 11 23:05:42 UTC 1999


Craig,

> > recv() and send() are called directly from the primitive, e.g.,
> > recv() from nextIntoStartingAtTCPSocket and send() from 
> > nextPutFromStartingAtTCPSocket - unless you have changed the 
> > primitives over the last two days. If any of these calls 
> block your VM 
> > stands still and does absolutely nothing!
> 
> 	I am AMAZED that you wrote that. Look at the code 
> again. Those calls WON'T block, because, by design, any 
> waiting that was necessary has ALREADY BEEN DONE. That's the 
> WHOLE POINT.

Okay, so here is the proof (perhaps then you stop using capital letters but
start thinking again). Execute the following code from a workspace ...

	"Server accepting single connection (using Squeak prims)"
	Socket initializeNetwork.
	server _ Socket newTCP.
	server listenOn: 22334.

	"Client pushing data (using Correspondants prims)"
	client _ NetStream tcpClientToPort: 22334 atHostNamed: 'localhost'.
	client nextPutAll: (String new: 100000). "<- This will block!"

.... and your Squeak stands forever. Now where is the whole point here?!

> 	Code please?

As soon as I have done some cleanup.

  Andreas





More information about the Squeak-dev mailing list