Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #15898

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

References <12715937.830.1321611809592.JavaMail.geo-discussion-forums@yqoo7> <mailman.2829.1321630394.27778.python-list@python.org> <14330307.286.1321631316567.JavaMail.geo-discussion-forums@yqcm23> <674531.1586.1321631509432.JavaMail.geo-discussion-forums@yqhd1>
Date 2011-11-19 03:04 +1100
Subject Re: Why sock.bind is always report 10048 error when in a script with multiprocessing
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2832.1321632261.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Sat, Nov 19, 2011 at 2:51 AM, Junfeng Hu <hujunfeng@gmail.com> wrote:
> And actually ,the socket hadn't been used in this script.

Doesn't matter that you haven't used it; you're binding to the port,
that's what causes the 10048.

I think the main problem is that you're trying to share sockets across
processes, but I haven't used the Python multiprocessing module with
sockets before. I would recommend, if you can, creating separate
sockets in each subprocess; that might make things a bit easier.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Why sock.bind is always report 10048 error when in a script with multiprocessing Junfeng Hu <hujunfeng@gmail.com> - 2011-11-18 02:23 -0800
  Re: Why sock.bind is always report 10048 error when in a script with multiprocessing Junfeng Hu <hujunfeng@gmail.com> - 2011-11-18 07:20 -0800
  Re: Why sock.bind is always report 10048 error when in a script with multiprocessing Chris Angelico <rosuav@gmail.com> - 2011-11-19 02:33 +1100
    Re: Why sock.bind is always report 10048 error when in a script with multiprocessing Junfeng Hu <hujunfeng@gmail.com> - 2011-11-18 07:48 -0800
    Re: Why sock.bind is always report 10048 error when in a script with multiprocessing Junfeng Hu <hujunfeng@gmail.com> - 2011-11-18 07:48 -0800
      Re: Why sock.bind is always report 10048 error when in a script with multiprocessing Junfeng Hu <hujunfeng@gmail.com> - 2011-11-18 07:51 -0800
      Re: Why sock.bind is always report 10048 error when in a script with multiprocessing Junfeng Hu <hujunfeng@gmail.com> - 2011-11-18 07:51 -0800
        Re: Why sock.bind is always report 10048 error when in a script with multiprocessing Chris Angelico <rosuav@gmail.com> - 2011-11-19 03:04 +1100
          Re: Why sock.bind is always report 10048 error when in a script with multiprocessing Junfeng Hu <hujunfeng@gmail.com> - 2011-11-18 08:11 -0800
          Re: Why sock.bind is always report 10048 error when in a script with multiprocessing Junfeng Hu <hujunfeng@gmail.com> - 2011-11-18 08:11 -0800
            Re: Why sock.bind is always report 10048 error when in a script with multiprocessing Chris Angelico <rosuav@gmail.com> - 2011-11-19 03:16 +1100
      Re: Why sock.bind is always report 10048 error when in a script with multiprocessing MRAB <python@mrabarnett.plus.com> - 2011-11-18 16:55 +0000
        Re: Why sock.bind is always report 10048 error when in a script with multiprocessing Junfeng Hu <hujunfeng@gmail.com> - 2011-11-18 18:45 -0800

csiph-web