Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 8 20:16:09 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 m893G94O030478 for ; Mon, 8 Sep 2008 20:16:09 -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 m893FG3n013314 for ; Mon, 8 Sep 2008 20:15:16 -0700 Message-Id: <200809090315.m893FG3n013314@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Regarding data being sent Date: Mon, 08 Sep 2008 20:15:16 -0700 From: Bill Cheng Someone wrote: > I think the question is while running the client, if u use localhost:portno > instead of nunki.usc.edu:portno, what shud the the server print > 1. Received x bytes from 127.0.0.1 or > 2. Received x bytes from nunki's IP address The spec says that you should call getpeername() and inet_ntoa(). I think you will get nunki's IP address but I'm not 100% sure. -- Bill Cheng // bill.cheng@usc.edu On Mon, Sep 8, 2008 at 6:57 PM, Bill Cheng wrote: > Someone wrote: > > > Is it acceptable if I print the IP of nunki at the server instead of the > > localhost (127.0.0.1) > > The adr command is to get the IP address given a hostname. > So, you should return the IP address if there is one. > -- > Bill Cheng // bill.cheng@usc.edu > >