Path: utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request From: fkittred@spca.bbn.com (Fletcher Kittredge) Newsgroups: comp.sys.sun Subject: Re: Pipes, sockets and coms processes Keywords: Networks Message-ID: <1213@brchh104.bnr.ca> Date: 12 Jan 91 15:16:13 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 16 Approved: Sun-Spots@rice.edu X-Refs: Original: v10n4 X-Sun-Spots-Digest: Volume 10, Issue 18, message 2 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu In article <1180@brchh104.bnr.ca> rbs@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@bbn.com / fkittred@das.harvard.edu