[ python-Bugs-701936 ] getsockopt/setsockopt with SO_RCVTIMEO are inconsistent

SourceForge.net noreply at sourceforge.net
Sun Jun 6 23:56:22 EDT 2004


Bugs item #701936, was opened at 2003-03-11 21:54
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=701936&group_id=5470

Category: Python Library
Group: Python 2.2.2
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: GaryD (gazzadee)
>Assigned to: Neal Norwitz (nnorwitz)
Summary: getsockopt/setsockopt with SO_RCVTIMEO are inconsistent

Initial Comment:
The SO_RCVTIMEO option to getsockopt/setsockopt seems
to vary it's parameter format when used under Linux.

With setsockopt, the parameter seems to be a struct of
{long seconds, long microseconds}, as you would expect
since it's modelling a C "struct timeval".

However, with getsockopt, the parameter format seems to
be {long seconds, long milliseconds} --- ie. it uses
milliseconds rather than microseconds.

The attached python script demonstrates this problem.

Am I doing something crucially wrong, or is this meant
to happen, or ... ?

What I'm using:
Python 2.2.2 (#1, Feb 24 2003, 17:36:09)
[GCC 3.0.4 (Mandrake Linux 8.2 3.0.4-2mdk)] on linux2


----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2004-06-06 23:56

Message:
Logged In: YES 
user_id=33168

Yes, I think this is not appropriate for Python to try to
resolve.  It would be very difficult to get right for all
platforms.  Thanks for the reminder.

----------------------------------------------------------------------

Comment By: GaryD (gazzadee)
Date: 2004-06-03 22:53

Message:
Logged In: YES 
user_id=693152

What do we do about this? Since it does not seem to be an
explciitly python problem, do we just resolve it as
"Rejected" or "Wont Fix"?

----------------------------------------------------------------------

Comment By: GaryD (gazzadee)
Date: 2003-08-14 00:33

Message:
Logged In: YES 
user_id=693152

Yes, you're right - the same thing happens with C.

Here's the output from sockopt.c on my system:

base (len 8) - 12, 345670
default (len 8) - 0, 0
after setsockopt (len 8) - 12, 20


----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-05-24 22:42

Message:
Logged In: YES 
user_id=33168

I just tested this on my box (Redhat 9/Linux 2.4).  I get
similar results with a C program as Python.  (Not sure why I
didn't get exactly the same results, but I'm tired.)  So I'm
not sure Python has a problem, since it is just exposing
what is happening in C.

Take a look at the C example and try it on your box.  What
results do you get?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=701936&group_id=5470



More information about the Python-bugs-list mailing list