Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!pnx.dk!amsnews11.chello.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'attribute': 0.07; 'subject:when': 0.07; 'from:addr:python': 0.09; 'subject:report': 0.09; 'subject:error': 0.10; 'skip:" 40': 0.15; 'from:addr:mrabarnett.plus.com': 0.16; 'from:name:mrab': 0.16; 'func(*args)': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.92': 0.16; 'received:84.92.122': 0.16; 'received:84.92.122.60': 0.16; 'reply-to:addr:python-list': 0.16; 'subject: \n ': 0.16; 'wrote:': 0.18; '(most': 0.21; 'header:In- Reply-To:1': 0.23; 'traceback': 0.24; 'load': 0.26; 'tried': 0.28; 'thanks': 0.31; 'comment': 0.32; 'to:addr:python-list': 0.32; 'header:User-Agent:1': 0.33; 'received:84': 0.34; 'last):': 0.34; 'reply-to:addr:python.org': 0.34; 'object': 0.35; 'skip:" 20': 0.35; 'file': 0.36; 'subject:skip:m 10': 0.36; 'using': 0.37; 'could': 0.38; 'subject:with': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'here': 0.65; 'family,': 0.67; 'header :Reply-To:1': 0.70; 'reply-to:no real name:2**0': 0.71; 'subject:always': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=TvRkdUrh c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=9jsOeB20M3cA:10 a=hwpRdV9lTX4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=W4Z-z-s0epiN__DfKuwA:9 a=wPNLvfGTeEIA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117 X-AUTH: mrabarnett:2500 Date: Fri, 18 Nov 2011 16:55:33 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Why sock.bind is always report 10048 error when in a script with multiprocessing References: <12715937.830.1321611809592.JavaMail.geo-discussion-forums@yqoo7> <14330307.286.1321631316567.JavaMail.geo-discussion-forums@yqcm23> In-Reply-To: <14330307.286.1321631316567.JavaMail.geo-discussion-forums@yqcm23> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: python-list@python.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1321635315 news.xs4all.nl 6871 [2001:888:2000:d::a6]:59733 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15903 On 18/11/2011 15:48, Junfeng Hu wrote: > Thanks > Yes, I had tried this before, so you could find that I comment the line > sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) > Here is the results. > D:\Python test>mythread2.py > Traceback (most recent call last): > File "", line 1, in > File "C:\Python27\lib\multiprocessing\forking.py", line 347, in main > self = load(from_parent) > File "C:\Python27\lib\pickle.py", line 1378, in load > return Unpickler(file).load() > File "C:\Python27\lib\pickle.py", line 858, in load > dispatch[key](self) > File "C:\Python27\lib\pickle.py", line 1133, in load_reduce > value = func(*args) > File "C:\Python27\lib\multiprocessing\reduction.py", line 167, in rebuild_sock > et > _sock = fromfd(fd, family, type_, proto) > File "C:\Python27\lib\multiprocessing\reduction.py", line 156, in fromfd > s = socket.fromfd(fd, family, type_, proto) > AttributeError: 'module' object has no attribute 'fromfd' The documentation for socket.fromfd says: Availability: Unix. You're using Microsoft Windows.