[squeak-dev] advice on efficient socket programming sought
Janko Mivšek
janko.mivsek at eranova.si
Fri Jul 18 21:11:26 UTC 2008
Hi Philippe,
By efficient you mean receiving and sending a lot such data? Or what
kind of efficiency you want to achieve?
Janko
Philippe Marschall wrote:
> Hi list
>
> Are there some guidelines available on doing efficient socket
> programming with Squeak for something like a server?
>
> My read pattern will be:
> - read one to four bytes
> - read a chunk of up to 8k bytes, the number of bytes is encoded in
> the bytes read before, these chunks can be either binary or text,
> again this depends on the bytes read above
> - repeat
>
> My write pattern will be similar. It could be made into bulk writes of up to 8k.
>
> Does it make sense to use Socket or is it too much hassle and I should
> use SocketStream? If I should go for SocketStream is constantly
> flipping between #binary and #ascii a bad idea? If is it preferable to
> run #ascii and convert the integer protocol constants to Characters or
> run #binary and send #asString to the resulting ByteArray?
>
> Cheers
> Philippe
>
>
--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
More information about the Squeak-dev
mailing list
|