Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Aug 30 14:00:33 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 m7UL0XMJ010871 for ; Sat, 30 Aug 2008 14:00:33 -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 m7UL7lXS014079 for ; Sat, 30 Aug 2008 14:07:47 -0700 Message-Id: <200808302107.m7UL7lXS014079@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Warmup project #1 Date: Sat, 30 Aug 2008 14:07:47 -0700 From: Bill Cheng Someone wrote: > I have a question regarding GET_RPLY. > > The spec says we have to use a small 512 byte buffer to read from a file. I > understand this as > > SERVER > > read 512 from file -> buffer -> write to socket > read next 512 from file ->buffer -> write to socket > ...... > > > at the CLIENT > > read 512 from socket -> buffer -> write to file > read next 512 from socket ->buffer -> write to file > ...... Well, there is no "write to file" for the client. The client has to compute MD5 checksum by calling MD5_Update() and then it can discard the data. > Now how should the client deal with this in terms of packets. The spec says > that the server sends a reply packet with DATA having the actual file > contents. If it wer a 2K file do we have to send 4 such packets and set the > offset field accordingly or should the client make a request for each of > these 4 packets separately with its offset till it gets the whole file? As it mentioned at the beginning of the spec (and during lecture 2), there is no "packets" in TCP. The word "packet" and "message" is interchangeable here. From the view of the client, there is just a stream of bytes coming from the server. It just read this stream 512 bytes at a time. -- Bill Cheng // bill.cheng@usc.edu