Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: "Martin A. Brown" Newsgroups: comp.lang.python Subject: Re: tcp networking question (CLOSE_WAIT) Date: Thu, 25 Feb 2016 10:17:27 -0800 Lines: 20 Message-ID: References: <7ff15c67-102e-4b02-a2c8-87b24f1b8351@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: news.uni-berlin.de d4MJ40bI2QrWBCBwGqB5LQjyBD+76Xr0I07GATXn+z/w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'socket': 0.07; 'subject:question': 0.08; 'cc:addr:python-list': 0.09; 'python': 0.10; '(other': 0.16; 'from:addr:martin': 0.16; 'received:hsd1.or.comcast.net': 0.16; 'received:io': 0.16; 'received:or.comcast.net': 0.16; 'received:psf.io': 0.16; 'tcp': 0.16; 'app': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'martin': 0.22; 'cc:no real name:2**0': 0.22; 'code.': 0.23; 'header:In-Reply-To:1': 0.24; 'received:24': 0.28; 'code': 0.30; 'problem': 0.33; 'received:comcast.net': 0.33; 'problem.': 0.35; 'subject:: ': 0.37; 'client': 0.37; 'charset:us-ascii': 0.37; 'waiting': 0.60; 'your': 0.60; 'received:network': 0.61; 'networking.': 0.84; 'thoroughly': 0.91 X-X-Sender: mabrown@macron.wonderfrog.net In-Reply-To: <7ff15c67-102e-4b02-a2c8-87b24f1b8351@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103513 >I'm new to python networking. I am waiting TCP server/client app by >using python built-in SocketServer. My problem is if client get >killed, then the tcp port will never get released, in CLOSE_WAIT I did not thoroughly review your code (other than to see that you are not using SO_REUSEADDR). This is the most likely problem. Suggestion: man 7 socket Look for SO_REUSEADDR. Then, apply what you have learned to your code. -Martin -- Martin A. Brown http://linux-ip.net/