Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 4 16:19:47 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 m94NJlla028866 for ; Sat, 4 Oct 2008 16:19:47 -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 m94NPAHX020168 for ; Sat, 4 Oct 2008 16:25:10 -0700 Message-Id: <200810042325.m94NPAHX020168@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Port Numbers Date: Sat, 04 Oct 2008 16:25:10 -0700 From: Bill Cheng Someone wrote: > When we send kill to ourselves what is the best way to find out our > processid. That is the first argument right? One thing you can do is to have your process write its pid when it starts. For example, right after you've read the startup configuration file and realized that your port nubmer is 12345, you can create a file in your home directory called "12345.pid". You should probably put #ifdef DEBUG around this code so that your submission will not have this turned on. To get your home directory, you can call getenv("HOME"). To get your process ID, you can call getpid(). It's probably best to call getpid() before you have created any child thread. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Friday, October 03, 2008 7:52 PM To: cs551@merlot.usc.edu Subject: Re: Port Numbers Someone wrote: > Would we be using the same port numbers as the ones used in warmup#1 ? Yes. > Also, initially we select four random port numbers from the range and > assign them to be the beacon nodes and enter that information in the > startup file. Is that right ? The best way is to follow the instructions at the bottom of the following page: http://merlot.usc.edu/cs551-f08/projects/testcases/p1.html This will convert the startup configuration we will use for grading to use your port numbers! -- Bill Cheng // bill.cheng@usc.edu