Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Aug 30 21:51:44 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 m7V4piu6014588 for ; Sat, 30 Aug 2008 21:51:44 -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 m7V4x35A018588 for ; Sat, 30 Aug 2008 21:59:03 -0700 Message-Id: <200808310459.m7V4x35A018588@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS 551 Warmup project #1 Date: Sat, 30 Aug 2008 21:59:03 -0700 From: Bill Cheng Someone wrote: > My code works when i send the entire buffer(message) at once but i get a > problem when i send and receive 1 byte at a time. Either i don't get all the > bytes(or get incorrect bytes) at the receiving end or i get a broken pipe. > How can i solve the broken pipe issue ? As far as I know, you get a broken pipe when you write to a socket and the socket has been closed by the other side. So, if you have not closed the socket on one end, the other side should not get a broken pipe signal. You need to investigate and find out why you are getting it. With regard to why your program does not work when you write and read one byte at a time, I cannot think of a reason. You should debug and find out why. Sorry that I'm not of much help here. > Also, when the client gets back the IP address from the server..the received > IP gets printed as 128.125.3.227u at the receiving end. You should probably zero out your buffer then you may not get the extra 'u' at the end. Please read the man pages carefully to see exactly what an networking API does. > Similarly,for some > .com and .net sites,the IP gets printed as x.x.x.x.net/com. For rest all > sites the o/p comes perfect (x.x.x.x) I'm not sure what you meant. Could you give a concrete example? You should compare this with what you get by running the "host" command on nunki. -- Bill Cheng // bill.cheng@usc.edu