TCP/IP Stream and recv?

Chris Campbell <>
Thu Feb 9 00:12:42 CET 2006


On 08/02/06, Per Hedeland <> wrote:
>
> Yes, I guess that's about right - assuming that you *want* to preserve
> message boundaries, of course. And if you do, and can't trivially
> determine them from the messages themselves, {packet, N} is probably the
> most obvious and trivial thing to implement in any other language too.

That's true, but {packet, N} assumes the client is trustworthy and
will send an N byte header containing the number of bytes followed by
that number of bytes.  If it sends less, the server will time out and
kill the connection.  If it sends more...

Anyway, I think I'm getting ahead of myself thinking about
untrustworthy clients.  I'm only playing at the mo'.

> And if both ends are Erlang, you could perhaps just use Erlang
> distribution instead, and just forget all about these worries...

:D

I figured I'd better learn socket programming properly since it's a
skill I don't really have, but might use.  Then again, almost
everything seems to be going over HTTP these days.

Thanks again,
Chris



More information about the erlang-questions mailing list