UDP sockets

Wojtek Walczak gminick at hacker.pl
Wed Oct 22 09:18:31 EDT 2003


Dnia 22 Oct 2003 11:15:35 +0200, Zunbeltz Izaola napisał(a):

> I'm porting a client writen in C++ to python. What is the way to get a
> timeout in an select for one socket? 

Quote from the ,,7.3 select -- Waiting for I/O completion'':

    The optional timeout argument specifies a time-out as a floating point 
    number in seconds.

So, it'll be something like this:

n = select.select([fds], [], [], 2)[0][0]

-- 
[ Wojtek Walczak - gminick (at) underground.org.pl ]
[        <http://gminick.linuxsecurity.pl/>        ]
[ "...rozmaite zwroty, matowe od patyny dawnosci." ]





More information about the Python-list mailing list