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

Chris Angelico rosuav at gmail.com
Fri Nov 18 10:33:11 EST 2011


On Fri, Nov 18, 2011 at 9:23 PM, Junfeng Hu <hujunfeng at gmail.com> wrote:
> 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.
> sock.bind((localIP,localPort))
> socket.error: [Errno 10048] Only one usage of each socket address (protocol/netw
> ork address/port) is normally permitted

Try setting the socket to SO_REUSEADDR.

ChrisA



More information about the Python-list mailing list