On 21 ago, 21:30, Seun Osewa <[EMAIL PROTECTED]> wrote:
> Is it possible to cause this sort of thing to happen on Windows.
> Specifically, I'm looking for a way to cause multiple processes to
> accept new connections on a bound socket. on UNIX, I can just fork()
> after binding the server socket
Is it possible to cause this sort of thing to happen on Windows.
Specifically, I'm looking for a way to cause multiple processes to
accept new connections on a bound socket. on UNIX, I can just fork()
after binding the server socket to a port and the children can
accept() on that same socket, but
Hrvoje Niksic wrote:
> alf <[EMAIL PROTECTED]> writes:
>
>> still would like to find out why it is happening (now FD_CLOEXEC
>> narrowed may yahooing/googling searches). While realize that file
>> descriptors are shared by forked processes it is still weird why the
>> port moves to the child proce
alf <[EMAIL PROTECTED]> writes:
> still would like to find out why it is happening (now FD_CLOEXEC
> narrowed may yahooing/googling searches). While realize that file
> descriptors are shared by forked processes it is still weird why the
> port moves to the child process once parent gets killed. w
The open file descriptor/socket shouldn't "move" between processes when you
kill the parent. When os.system forks, anything you've got open in the
parent will transfer to the child. Both descriptors reference the same open
port. Running the same 'ss' and 'cc' code you've supplied behaves like t
On Fri, 20 Jul 2007 08:15:39 -0500, alf <[EMAIL PROTECTED]> wrote:
>Jean-Paul Calderone wrote:
>
>>
>> You can avoid this, if you like. Set FD_CLOEXEC on the socket after you
>> open it, before you call os.system:
>>
>> old = fcntl.fcntl(s.fileno(), fcntl.F_GETFD)
>> fcntl.fcntl(s.fileno(), fcnt
Jean-Paul Calderone wrote:
>
> You can avoid this, if you like. Set FD_CLOEXEC on the socket after you
> open it, before you call os.system:
>
> old = fcntl.fcntl(s.fileno(), fcntl.F_GETFD)
> fcntl.fcntl(s.fileno(), fcntl.F_SETFD, old | fcntl.FD_CLOEXEC)
>
thx for responding (I was about to
On Thu, 19 Jul 2007 21:07:55 -0500, alf <[EMAIL PROTECTED]> wrote:
>
>Hi,
>
>I need a help with explaining following behavior. Although it is not
>python issue per say, python helped me to write sample programs and
>originally I encountered the issue using python software. So let's
>assume we have
What's unexpected about it? Child processes inherit all of the open file
descriptors of their parent. A socket is simply another open file
descriptor. When your parent process exits, your child still holds a valid,
open file descriptor.
import sys
import socket
import os
import time
s = socket
Hi,
I need a help with explaining following behavior. Although it is not
python issue per say, python helped me to write sample programs and
originally I encountered the issue using python software. So let's
assume we have two following programs:
[myhost] ~> cat ss.py
import socket
UDPSock=
10 matches
Mail list logo