delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/10/11/12:23:03

From: edwards AT sk DOT sympatico DOT ca (Colten Edwards)
Subject: Re: select()
11 Oct 1998 12:23:03 -0700 :
Message-ID: <Pine.LNX.3.96.981011044806.8594A-100000.cygnus.gnu-win32@panasync.canuck.ca>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 981009090931 DOT 7098A-300000 AT grout>
Reply-To: edwac AT sk DOT sympatico DOT ca
Mime-Version: 1.0
To: "Todd M. Grimm" <grimm AT itd DOT nrl DOT navy DOT mil>
Cc: gnu-win32 AT cygnus DOT com, Michael Czapski <MCzapski AT openplus DOT com DOT au>,
Harry Broomhall <haeb AT demon DOT net>


On Fri, 9 Oct 1998, Todd M. Grimm wrote:

> On Wed, 7 Oct 1998, Todd M. Grimm wrote:
> > I am using select() to test whether there are bytes on a socket to read 
> > without blocking my program to check on this.
> > 
> > The problem is that even when there is no data it returns a 1 to say that 
> > there is data. This causes my program to try a read which blocks because 
> > there really is no data.
> > 
> > I saw several messages in the archives of this list about this, but all I 
> > could find were questions. No one ever seemed to answer the question.
> > 
> > Please let me know if you know how to get select() to work right or if 
> > there is a nother way to test for bytes without blocking.
> 
> Thanks to Harry and Michael for their responses. Above is my original 
> notes. I am still having problems.
> 
> I have isolated two small .C files that demonstrate what I am doing (wrong).
> 
> I am hopeful that they will help one of you to spot my problem or confirm 
> that you have the same problem.
> 
> I am running on Windows NT 4.0 using B19 of the Cygwin g++. I am using 
> version 19.1 of the dll file. 19.0 and 19.4 have the same problem. With 
> 19.4 my bash shell failed to read .bashrc so I gave up on that.
> 
> So, attached is the code. The first file describes how to run it. There are 
> compile statements in their respective files. 
> 
> Thanks a bunch (I am really stuck),
> Todd

I'm having exactly the same trouble with the irc client I ported.. select
blocks, until a key is pressed, even if there is data available on the
socket. I mentioned this on the mailing list back when b18 came out, but
there wasn't a answer to my question.. There is nothing odd with what I'm
doing with select(), it's standard unix code that runs fine under alot of
varities of unix. 
ftp.bitchx.com//pub/BitchX/clients/windows  and get the .exe file there.
Run the program and make the window loose focus. It's now blocked in the
select call. and won't come back until a key is pressed while the window
has focus. This occurs in windows on the desktop and windows in the
background

						Colten Edwards
						panasync AT efnet


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019