This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bug: select() for sockets returned by accept() returns always ready for write (sel.always_ready 1)


Hi,

I am using non-blocking sockets in a small server software. Select() seems to indicate that sockets returned by accept() are always ready for write. This causes 99% cpu usage since the socket gets always selected as writeable and after that write returns EAGAIN and again we go to the select().

After looking select.cc fhandler.cc fhandler_socket.cc I think that the reason could be that in fhandler_socket::accept the socket is not set to CONNECTED state and in fhandler_socket::select_write sets write_ready if socket is in unconnected state.

(uname -a
CYGWIN_NT-5.0 O1400031 1.3.19(0.71/3/2) 2003-01-23 21:31 i686 unknown unknown Cygwin)

- Risto
-
Sunpoint tiedottaa:

Puhelintuki numerossa 0600-10 900 1,83E/min+pvm

Tutustu myös Etätukeen tästä
http://www.sunpoint.net/SunAds/click.htm?mode=footer&id=70&jump=http%3A%2F%2Fwww.pilotvastauspalvelu.fi%2Fdefault.asp%3Fsivu%3D3

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]