From owner-p4-projects@FreeBSD.ORG Sun Jul 22 08:28:58 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6641A16A41F; Sun, 22 Jul 2007 08:28:58 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2445016A419 for ; Sun, 22 Jul 2007 08:28:58 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1602F13C442 for ; Sun, 22 Jul 2007 08:28:58 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l6M8SvbU031199 for ; Sun, 22 Jul 2007 08:28:57 GMT (envelope-from andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l6M8Svai031196 for perforce@freebsd.org; Sun, 22 Jul 2007 08:28:57 GMT (envelope-from andrew@freebsd.org) Date: Sun, 22 Jul 2007 08:28:57 GMT Message-Id: <200707220828.l6M8Svai031196@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andrew@freebsd.org using -f From: Andrew Turner To: Perforce Change Reviews Cc: Subject: PERFORCE change 123884 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2007 08:28:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=123884 Change 123884 by andrew@andrew_hermies on 2007/07/22 08:28:34 Recreate the front end communications thread after disconnection. This allows us to reconnect Don't die when closing the connection and the other end has already closed Affected files ... .. //depot/projects/soc2007/andrew-update/frontend/facund/computer.py#6 edit .. //depot/projects/soc2007/andrew-update/frontend/facund/network/__init__.py#9 edit Differences ... ==== //depot/projects/soc2007/andrew-update/frontend/facund/computer.py#6 (text+ko) ==== @@ -133,6 +133,7 @@ self.start() except socket.error: print "Couldn't connect to " + self.__host + del self.__connection self.__connection = None def disconnect(self): @@ -141,6 +142,10 @@ return self.__connection.disconnect() + # Wait for the thread to exit then create a new thread + self.join() + threading.Thread.__init__(self) + del self.__connection self.__connection = None def run(self): ==== //depot/projects/soc2007/andrew-update/frontend/facund/network/__init__.py#9 (text+ko) ==== @@ -57,7 +57,10 @@ if self.isReady: self.isReady = False # Send a connection close - self.socket.send("") + try: + self.socket.send("") + except socket.error: + pass # Wait for the other end to close self.__connected_lock.acquire()