Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
Hi All, I'm trying to leverage my core i5 to send more UDP packets with multiprocssing, but I found a interesting thing is that the socket.bind is always reporting 10048 error even the process didn't do anything about the socket. Here is the script import threading,socket,random,pp,os import

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
I did a test on linux, it works well, so the issue is related to os. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
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 testmythread2.py Traceback (most recent call last): File string, line 1, in module File

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
And actually ,the socket hadn't been used in this script. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
Hi Chris. The socket only binded once. That's the problem I'm puzzleing, I think it may a bug of multiprocessing in windows, or something I missed. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
On Nov 18, 10:55 am, MRAB pyt...@mrabarnett.plus.com wrote: 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 testmythread2