Bugs item #1308042, was opened at 2005-09-29 10:05 Message generated for change (Comment added) made by tvrankar 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: Tom Vrankar (tvrankar) Date: 2005-09-30 13:50 Message: Logged In: YES user_id=1353485 With Python around, I don't program much in C anymore, and for the same reason I usually assume platform independence (ensured by some clever Python programmer -- C or lib -- spackling over minor underlying differences) unless the Python docs explicitly tell me otherwise. nnorwitz's Linux results match my Solaris 8 results (and are what I intended). I submitted this report since the docs didn't provide any warnings about Python's UDP sockets behaving differently per platform. The behavior I saw would be wacky even on Windoze, but I don't know just how tolerant Windoze developers are of a poor sockets implementation :-). ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2005-09-30 01: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-30 01: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): [EMAIL PROTECTED] clean $ ./python PyBug/client.py & [1] 31484 [EMAIL PROTECTED] 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 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com