Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 4 14:45:38 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 m84LjbHm027485 for ; Thu, 4 Sep 2008 14:45:37 -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 m84LhhBq012744 for ; Thu, 4 Sep 2008 14:43:43 -0700 Message-Id: <200809042143.m84LhhBq012744@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551 port #s Date: Thu, 04 Sep 2008 14:43:43 -0700 From: Bill Cheng Someone wrote: > I have a question regarding the given command line syntax: > server [-t seconds]...........port > client {adr|fsz|get} ............port string > > Are these two ports referring to the same port number? Yes. The server's port number is called the "well-known" port because all the clients are suppose to know what the number is and use it in the commandline. > If yes, does that mean our code should assign a random port > number to the client and use the supplied port number as the > server's port number since the client needs its own port and a > port to send to? Correct. You must *not* specify what port number to use for the client's end of the TCP connection! You should let the operating system assigns a random port number for this. > If no, does it mean we have to find a way of getting a second > port number to the client since only one is allowed in the > "client" command line? If you start with the skeleton code given in lecture 2, your client would use a random chosen port number for its end of the TCP connection. -- Bill Cheng // bill.cheng@usc.edu