[squeak-dev] Re: SocketStream>>atEnd

Jon Hylands jon at huv.com
Fri Jan 15 00:29:10 UTC 2010


On Fri, 15 Jan 2010 01:00:54 +0100, Göran Krampe <goran at krampe.se>
wrote:

>...but thanks for digging in the SocketStream code! It was quite a while 
>since I wrote it :)
>
>While we are at it we should improve the primitive for searching in 
>String/ByteArrays to include at stopAt: argument. This would increase 
>speed and simplify the horribly tricky logic in the upTo: family of 
>methods in SocketStream.

It would be nice if, for whoever is doing this, you could include some
kind of switch to indicate how the socket is being used. Most people
retrieve large files and images over sockets, but in my robotics work
I use them for sending and receiving very small commands, on the order
of 10-20 bytes typically.

From the comment in #upTo:

"Another measure is that this implementation is greedy and will load
data into the buffer until there is nothing more available, or it has
loaded 100kb - and not until then we search the buffer."

I need an implementation of #upTo: that is much more direct - I ended
up writing my own for now, that uses a much smaller constant.

Thanks,
Jon




More information about the Squeak-dev mailing list