Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 1 21:26:08 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m924Q8Ab019703 for ; Wed, 1 Oct 2008 21:26:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m924Uo9b029014 for ; Wed, 1 Oct 2008 21:30:50 -0700 Message-Id: <200810020430.m924Uo9b029014@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: final project part 1 doubts Date: Wed, 01 Oct 2008 21:30:50 -0700 From: Bill Cheng Someone wrote: > I have the following doubts related to final project. > > 1. Regarding memory allocation while receiving > > Can we allocate memory statically while receiving i.e. allocate a buffer of > 100 or 200 bytes and then receive message in the buffer. > > Or we have to do the same way we did in Warmup project 1 i.e. read the > header and depending on the datalen dynamically allocate memory. I have just changed the spec to say that, for part (1), there is no memory buffer limitation! This is because we don't have really long messages (such as file transfers). > Also do we read the data one byte at a time? No. You don't have to read/write one byte at a time. Since we can assume that the nodes are not malicious, when you read a message, you should read the common header first, and all in one shot. Then you parse the common header and figure out what Data Length is. Then you can decide how you want to read the data. > 2. Related to the nonce id. > > Is nonce instance id a null terminated string or array of characters. I think you meant "node instance ID". This is your internal data structure. You can do whatever you want. -- Bill Cheng // bill.cheng@usc.edu