Message67511
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 |
|
| Date |
User |
Action |
Args |
| 2008-05-29 21:02:39 | mamulsow | set | spambayes_score: 0.287629 -> 0.287629 recipients:
+ mamulsow |
| 2008-05-29 21:02:39 | mamulsow | set | spambayes_score: 0.287629 -> 0.287629 messageid: <1212094958.77.0.0391223554576.issue3006@psf.upfronthosting.co.za> |
| 2008-05-29 21:02:37 | mamulsow | link | issue3006 messages |
| 2008-05-29 21:02:36 | mamulsow | create | |
|