[squeak-dev] advice on efficient socket programming sought

Philippe Marschall philippe.marschall at gmail.com
Fri Jul 18 20:59:51 UTC 2008


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



More information about the Squeak-dev mailing list