[ANN] Jabber 2.0b on SqueakMap

Stephen Pair stephen at pairhome.net
Sat Jul 26 01:02:17 UTC 2003


Julian Fitzell wrote:

> Ned Konz wrote:
>
>> On Friday 25 July 2003 03:14 pm, Julian Fitzell wrote:
>>
>>> We really need something like kom-services in the base
>>> image (I want some kind of listener that I can give a port and a
>>> handler class or block or something and it will run one for each
>>> incoming connection).
>>
>>
>>
>> We have ConnectionQueue, and there's already chunks of server logic 
>> that use it in EToyPeerToPeer, Nebraska, and probably in PWS as well, 
>> but I didn't look at it.
>>
>> It looks easy enough to use (this is from EToyPeerToPeer):
>>
>>     [true] whileTrue: [
>>         socket _ connectionQueue getConnectionOrNilLenient.
>>         socket ifNil: [
>>             (Delay forMilliseconds: 50) wait
>>         ] ifNotNil: [
>>             self class new receiveDataOn: socket for: communicatorMorph
>>         ]
>>     ].
>>
>> However, I don't think the recursion in ConnectionQueue>>listenLoop 
>> is all that safe. It seems like retries on invalid sockets should be 
>> handled by the callers.
>
>
> Yeah, I looked at ConnectionQueue (and even at the code that used it 
> in Nebraska) but the code in Nebraska did a bunch of stuff I didn't 
> need and ConnectionQueue seemed to be missing, basically, the chunk of 
> code you have above.  I have no idea whether doing a loop with a 50ms 
> delay is the right way to do that or not... there should be a class 
> one level higher than ConnectionQueue in the base image that know the 
> right way to do it and just lets me right the code to handle the 
> connection.
>
> I'm not demanding anyone do this, by the way, I sort of started doing 
> it myself, but I'm not the most qualified to do it and it would be 
> nice to end up with something that everyone could comfortably use.
>
> I also haven't actually looked at kom-services yet - Avi just told me 
> that was what I was looking for when I mentioned it.
>
> Julian


Well, then why not use KomServices?  I would cetainly not object to its 
inclusion in the base image either.

- Stephen



More information about the Squeak-dev mailing list