next up previous Back to Operating Systems Home Page
Next: A4: Return status of Up: 1998 term messages Previous: A4 - handing in

A4 - Sockets, reading in chunks

On Sat, 11 Apr 1998, Azeem Lakdawalla wrote:

> Sometimes when I send many write's to a socket, they are received as one
> long text chunk as opposed to the smaller ones I send separately. If I add
> a delay in between each write, it works fine. Why is this and what should
> I do?

If you really need it, use SOCK_DGRAMs. STREAM sockets, by definition, do
not guarantee record boundaries: they offer a virtual circuit looking
like a continuous stream of data, and it is the responsibility of
the application to impose a structure on it. In a word, they look
pretty much like UNIX files.

Ciao
Franco


\ Franco Callari