Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 7 18:22:39 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 m881MdtX013751 for ; Sun, 7 Sep 2008 18:22:39 -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 m881LULw021391 for ; Sun, 7 Sep 2008 18:21:30 -0700 Message-Id: <200809080121.m881LULw021391@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Date: Sun, 07 Sep 2008 18:21:30 -0700 From: Bill Cheng Someone wrote: > If the server is sending the data, and if the client closes the > connection, how will the server know that the client connection has > closed because the server may have already sent all the data, by then? If the server has finished sending the data, it should just shutdown and close the socket. Then it wouldn't care if the client is closing the connection or not. -- Bill Cheng // bill.cheng@usc.edu On Sun, Sep 7, 2008 at 2:18 PM, Bill Cheng wrote: > Someone wrote: > > > If the server is in a long data transfer with the client during which the > > server process is interrupted and terminated, should the client display the > > data that it has received until that point or shoud it just say server > > terminated and quit, > > If the client does not receive the whole message, it should > print an error message and quits. > > > and what about vice versa, if the client shuts down > > what should happen? > > The child thread or process should just quietly terminate. > If you use a logfile, you can log this error to the logfile. > But you should *not* write the error to stdout or stderr. > -- > Bill Cheng // bill.cheng@usc.edu > >