[ python-Bugs-1308042 ] Datagram Socket Timeouts
SourceForge.net
noreply at sourceforge.net
Fri Sep 30 07:43:28 CEST 2005
Bugs item #1308042, was opened at 2005-09-29 07:05
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1308042&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: Works For Me
Priority: 5
Submitted By: Tom Vrankar (tvrankar)
Assigned to: Nobody/Anonymous (nobody)
Summary: Datagram Socket Timeouts
Initial Comment:
Python 2.4.1, MS Windows 2000 with service packs
I'm trying to have a UDP client check for its server to
start by repeatedly throwing messages at where it's
expected to appear, and then checking for a response. I
set a timeout on the recvfrom, expecting to block for
the timeout and then proceeding to an exception
handler, looping so until data is returned. Instead,
the recvfrom throws an immediate exception "Connection
reset by peer", and I loop rapidly without the
load-softening effect of the timeout (in fact, it's the
same behavior as if I didn't set the timeout at all).
What UDP "connection" is it talking about?
Seems wrong, but is it the implementation or is it me?
If I start the server first, I get one "Invalid
argument" exception in the client. In both cases, once
the server is started, both processes are satisfied.
Thanks.
twv
----------------------------------------------------------------------
>Comment By: Neal Norwitz (nnorwitz)
Date: 2005-09-29 22:43
Message:
Logged In: YES
user_id=33168
This is a dupe of 1307357, but I'm closing that one since
most of the comments are here. However, note this one
comment from twv in the other report that says it also works
on Solaris 8 and could well be Windoze specific.
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2005-09-29 22:30
Message:
Logged In: YES
user_id=33168
Can you program the client in C and see if it behaves the
same? Sockets are mostly just wrappers around the OS calls.
It's possible this is the expected behaviour on Windows and
python is just exposing that to you.
I ran this on Linux and got this (which is what I think you
want):
neal at janus clean $ ./python PyBug/client.py &
[1] 31484
neal at janus clean $ timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
timed out
./python PyBug/server.py
timed out
timed out
timed out
('127.0.0.1', 40899) says CHECK
('127.0.0.1', 3000) says OK
[10587 refs]
[10585 refs]
[1]+ Done ./python PyBug/client.py
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1308042&group_id=5470
More information about the Python-bugs-list
mailing list