Pipes, sockets and coms processes

Fletcher Kittredge fkittred at spca.bbn.com
Sun Jan 13 02:16:13 AEST 1991


In article <1180 at brchh104.bnr.ca> rbs at aiai.ed.ac.uk (Robert Scott) writes:
>Given two processes communicating via a socket, how does the receiver know
>the length of the senders message?  In the relevant manual on
>interprocessor communication the examples given send fixed length
>messages. I need to be able to send variable length messages where the
>receiver won't know message length at compile time.

What is your protocol?  TCP/IP is a byte stream protocol, so if you are
using it, then you will have define your own protocol to send your own
packet headers with lengths for the data portion of the messages.  This is
less difficult than it sounds.  I recommend that you pick up a copy of
Stevens, "Unix Network Programming" [Prentice-Hall]

Regards,
Fletcher Kittredge
617-873-3465  /  fkittred at bbn.com  /  fkittred at das.harvard.edu



More information about the Comp.sys.sun mailing list