Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 26 07:11:58 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 m9QEBvCJ005310 for ; Sun, 26 Oct 2008 07:11:58 -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 m9QEMZj2016341 for ; Sun, 26 Oct 2008 07:22:35 -0700 Message-Id: <200810261422.m9QEMZj2016341@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Soft restart Date: Sun, 26 Oct 2008 07:22:35 -0700 From: Bill Cheng Someone wrote: > When we do a soft restart, we close sockets we are connected to during join. > After that the non-beacon comes up again, reads its init_neighbor_list file > and creates one thread to connect to each of its neighbors, and also creates > one server to accept connections. > > This newly created server is always getting a bind failed error. We have > tried from 2 different sets of port numbers. > > What could be the problem ? First, you need to isolate the problem and see if this happens under other conditions. Instead of doing a soft restart, you can let your code terminate normally and start it manually right away. Does this problem happen? If not, and if you have already been calling setsockopt() with SO_REUSEADDR and have closed your server's master socket properly, then you just need to find out what's the difference between soft restart and normal termination above. -- Bill Cheng // bill.cheng@usc.edu