public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* problem/bug in select command of socket / winsock
@ 2001-07-25 12:29 haase
  2001-08-02  7:53 ` Christopher Faylor
  0 siblings, 1 reply; 2+ messages in thread
From: haase @ 2001-07-25 12:29 UTC (permalink / raw)
  To: cygwin

Hi,
I wrote a C++ / wxWindows (very nice GUI lib :-) program.
It normally handles TCP/IP socket communication by utilizing it's
"event-handling" system - so that e.g.  recv() doesn't block the program
until data arrives  -- all that works fine.

But I have a extra / second thread dedicated just to read from a socket .
This _HAS_ to block on recv - otherwise it would run in circles and use up
100% CPU while waiting on data. This mode in wxWindows is activated with:
socket->SetFlag(wxSOCKET_BLOCK).  I found that that is implemented by
using a ("blocking") select()  [somewhere inside a part that wxWindows
calls their GSocket implementation]

So: all this works fine when I compile on VC++ (6)
    But cygwin just seems to run right through the select() call  [ I used
the gdb -- very fancy :-)) someone did a good job!! ]


I read that there is an issue about if or how to use the winsock part or
the posix-compliant cygwin version  .   Is that a way to influence that
or did I just found a bug?

Thanks, have a great day,

Sebastian Haase
University of California, San Francisco
(415)502-4316



--
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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: problem/bug in select command of socket / winsock
  2001-07-25 12:29 problem/bug in select command of socket / winsock haase
@ 2001-08-02  7:53 ` Christopher Faylor
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Faylor @ 2001-08-02  7:53 UTC (permalink / raw)
  To: cygwin

On Wed, Jul 25, 2001 at 12:31:08PM -0700, haase@msg.ucsf.edu wrote:
>Hi,
>I wrote a C++ / wxWindows (very nice GUI lib :-) program.
>It normally handles TCP/IP socket communication by utilizing it's
>"event-handling" system - so that e.g.  recv() doesn't block the program
>until data arrives  -- all that works fine.
>
>But I have a extra / second thread dedicated just to read from a socket .
>This _HAS_ to block on recv - otherwise it would run in circles and use up
>100% CPU while waiting on data. This mode in wxWindows is activated with:
>socket->SetFlag(wxSOCKET_BLOCK).  I found that that is implemented by
>using a ("blocking") select()  [somewhere inside a part that wxWindows
>calls their GSocket implementation]
>
>So: all this works fine when I compile on VC++ (6)
>    But cygwin just seems to run right through the select() call  [ I used
>the gdb -- very fancy :-)) someone did a good job!! ]
>
>
>I read that there is an issue about if or how to use the winsock part or
>the posix-compliant cygwin version  .   Is that a way to influence that
>or did I just found a bug?

You really haven't provided enough details to tell if this is a bug
or not.

AFAIK, there aren't any issues with select on sockets.  If there were then
things like inetd or ssh would be inoperable.

cgf

--
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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-02  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-25 12:29 problem/bug in select command of socket / winsock haase
2001-08-02  7:53 ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).