[Q] Can Squeak listen on two sockets from the same image?

Chris Muller afunkyobject at yahoo.com
Thu Jun 20 15:19:20 UTC 2002


I have a network testing exercise that involves running four Squeak images. 
Image #1 is the "test conductor", image #2 is client1, image #3 is client2 and
image #4 is the server.

The conductor image sends "commands" to images 2, 3 and 4 to that cause them to
communicate with each other according to the parameters of the test.  As you
can imagine, one of the very first requests is sent to image #4 to "start the
server".  This means image #4 is actually listening on TWO sockets.  One for
handling requests from the test conductor such as, "startServer," "stopServer",
and various "console" operations.  The other for handling requests from the
other two client images that are participating in the actual test.

In the "server" image (image #4), the server-socket being tested runs in a
forked Process, the socket listening for conductor requests runs in the UI
process.

Everything is fine for the first half of the test script.  But then the Socket
listening in the forked process misses connections from client images.  In
fact, the client image thinks it gets a connection and even sends its data
until sendDone and then waits to receive a response.  But when I interrupt the
server and look at the one in the forked process, it is still waiting on a
connection or sometimes waiting to receive data from the clients send.

This happens at the exact same point in the test script each time.

I'm not sure whether I'm dealing with a Process tangle (e.g., the forked
process didn't get time), a Socket tangle (e.g., the two listening Sockets
stepped on each others state), or something else.  Of all four images running
in this exercise, the only one that ever has a problem is #4, the server, which
is the only one that is listening on two sockets.

Any ideas would be greatly appreciated!


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



More information about the Squeak-dev mailing list