ConnectionQueue + SharedQueue question???

Rob Withers slosher2 at home.com
Tue Oct 24 06:16:41 UTC 2000


How are you asking the socket to receive data?  If you are using
#getData, it uses a timeout and there is no gaurantee that this was long
enough.  It may suite your situation better to read data out of the
socket until it closes.

Rob

jchludzinski at worldkey.net wrote:
> 
> 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

-- 
--------------------------------------------------
Smalltalking by choice.  Isn't it nice to have one!





More information about the Squeak-dev mailing list