This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mamulsow
Recipients mamulsow
Date 2008-05-29.21:02:30
SpamBayes Score 0.28762895
Marked as misclassified No
Message-id <1212094958.77.0.0391223554576.issue3006@psf.upfronthosting.co.za>
In-reply-to
Content
On Windows, when a suprocess.Popen command is issued while
a socket connection is being handled the socket connection
will not close until the output of the subprocess is consumed.
The connection remains open even though the request.close()
command returns successfully and the program starts listening
for the next connection.

On Windows, the request.close() call translates to the C function
closesocket. The closesocket function by default attempts to do
a graceful close in the background. By changing the linger structure,
the closesocket function can be made to do a hard close. That fixes
my problem, but then queued data may not be flushed before the
socket closes. I cannot figure out why the closesocket's graceful
shutdown is waiting for the Popen command to complete.

This problem does not show up with the equivalent os.popen command.

To reproduce:
    run socketTest.py
    use telnet to connect on port 6288
    watch for connection to close or not
History
Date User Action Args
2008-05-29 21:02:39mamulsowsetspambayes_score: 0.287629 -> 0.28762895
recipients: + mamulsow
2008-05-29 21:02:39mamulsowsetspambayes_score: 0.287629 -> 0.287629
messageid: <1212094958.77.0.0391223554576.issue3006@psf.upfronthosting.co.za>
2008-05-29 21:02:37mamulsowlinkissue3006 messages
2008-05-29 21:02:36mamulsowcreate