All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
Issues with select
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login |
|
|
Issues with select - Jul. 21, '03, 6:56:26 AM
|
|
|
sfubernd
Posts: 8
Joined: Nov. 26, '02,
Status: offline
|
All:
Are there any known issues with select()? I find myself in a situation in which select() doesn' t tell me that a socket is ready for reading (and it is!). Any comments?
On a sidenote, it would be nice if Interix implemented poll().
Thanks,
-Bernd
|
|
|
RE: Issues with select - Jul. 21, '03, 10:21:47 AM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
There are two known issues with select(). One issue centers around the timeout arg if it is a really small value; the call will get stuck in the kernel. It tends to appear on fast (>2.2Ghz) dual+ systems with a heavy load (e.g. X11 animation). There was a potential hot fix back in January but it didn' t cover enough of the problem. I just got another potential on Friday, but the group hasn' t had a chance to give it a whirl yet. The second was more straightforward: it had to do with all the args being NULL or something like that (an easy fix).
For your select() problem what are all of the args that you are passing to the API? What type of socket is it (INET, UNIX)? If INET is it a loopback/127.0.0.1 or onto the NIC proper? Was the read queue totally clear before the select started? How much data is getting into the queue? What is the data? Does select() go off if the data queue gets even more information? Is the info in the read queue sent in one write or several writes? What types did you declare each of the args? What value does each arg have at the start of the call?
There is a partial implementation of poll(). It has just enough functionality for gdb(1)' s needs. I' ve passed along the request about poll() being fully functional a few times. There is the possibility the next release might have it, but I truely don' t know for sure.
Rodney
|
|
|
RE: Issues with select - Jul. 21, '03, 2:15:13 PM
|
|
|
sfubernd
Posts: 8
Joined: Nov. 26, '02,
Status: offline
|
Hello Rodney:
I' m passing 5 descriptors to select(), 4 of which are listening sockets and one socket has been accept()ed. I' m also passing in a timeout of 5000 microseconds. While this is a small timeout, the call doesn' t get stuck, but simply doesn' t tell me that data is available for reading.
The set of exceptional descriptors is set to 0. The read and write sets should be correct.
The socket types are AF_INET.
I' m connecting to the same machine, but via its ethernet address 192.168.x.x, not loopback.
The code works fine under Cygwin.
I' m not sure whether the read queue was entirely empty. The socket was just accepted. Are you suggesting data was available when the socket was accepted and therefore the subsequent select() fails?
The data is an HTTP request.
Oops, I have to run. More later.
Thanks again,
-Bernd
|
|
|
RE: Issues with select - Jul. 21, '03, 2:20:48 PM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
thanks for the info. I' ll think on it a bit.
> Are you suggesting data was available when the socket was accepted and therefore the subsequent select() fails?
no, I' m just trying to gather info to maybe narrow it down.
- Rodney
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|