select.poll returning strange file descriptors.

S

Simon Wittber

I'm using the poll object from select.poll to check for events on
sockets.

It seems to work, however when I call .poll() on the poll objects, I
sometimes get a fileno 1 returned, which is strange, because none of
the sockets I registered with the poll object have a fileno of 1. In
fact, the sockets all start from fileno 3 and go up from there.

Does anybody know why this is happening?
 
S

Simon Wittber

Solved.

I was using poll.register(fileno) without any flags specfied, which
means "tell me when _anything_ happens".

Because of this, I was receiving OOB data, which seems to use strange
fileno values.

to fix this, I now use this:

poll.register(sock.fileno(), select.POLLIN|select.POLLOUT|
select.POLLERR|select.POLLHUP)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,291
Messages
2,571,455
Members
48,132
Latest member
KatlynC08

Latest Threads

Top