ConnectionQueue + SharedQueue question???
jchludzinski at worldkey.net
jchludzinski at worldkey.net
Tue Oct 24 04:46:33 UTC 2000
I'm using ConnectionQueue and SharedQueue to achieve an exchange of
Events between sims. I place an Event in the SharedQueue (via a
'nextPut:'). There is a Process (infinite loop) continuously doing
a 'next'. When an Event is placed on the SharedQueue, a Socket is
created (newTCP) to send the Event. Once the Event has been sent,
I print bytesSent. Afterward I destroy the Socket.
On the receiving side (another Squeak image) I'm using a
ConnectionQueue to create a Socket to receive the Event - again
another infinite loop (infinitely testing the ConnectionQueue via a
'getConnectionOrNil notNil'). I check for bytesReceived. Once the
Event has been received, I print bytesReceived.
My problem is that often I get: bytesSent = 20 and bytesReceived =
0 (an Event is placed a 'ByteArray new: 20'). I execute:
ConnectionQueue allInstances do: [ :cq | cq destroy ], in addition
to terminating both Processes (infinite loops) - just to make sure.
I added a Delay (forSeconds: 10) before beginning the receiving
Process (an infinite loop using ConnectionQueue). This seems to
have eliminated the problem - INITIALLY. Only to have the problem
occur later.
Any suggestions???
---John
More information about the Squeak-dev
mailing list
|