Article View: borland.public.cppbuilder.nativeapi
Article #6455Re: Response not in que?
From: Neil P.
Date: Mon, 09 May 2005 20:57
Date: Mon, 09 May 2005 20:57
43 lines
2664 bytes
2664 bytes
Well, I am using overlapped I/O. The problem is that I don't want my code to lock up. If the other unit does not respond, I want the read function to quit, but what is a good time to quit? How about if I dishout an application that works well with this unit, under the environment I am in, but when the user gets it, the unit or my application seems that it is lockout (because he/she has a pentium 100, operating on Win95)? <---- Just an example. I was using the WaitForSingleObject(), but it did not make a difference, where I enabled it or not? Anyways, lets see if I can display a snippet from my code. Thank you, Neil P. "Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message news:427fce92$1@newsgroups.borland.com... > > "Neil P." <nporve01@hotmail.com> wrote in message > news:427fca8b$1@newsgroups.borland.com... > > > I use ClearCommError(hComm, &dwErrorMask, & Comstat) > > > > to view what is coming in the cbInQue, > > When do you call it, though? Are you checking for errors? Please show a > code snippet of what you are actually doing. > > Rather than using ClearCommError(), why not just read immediately after > writing? You are already expecting a byte to be written, so just read > immediately and let the reading block until the byte actually arrives. It > also looks like you are using overlapped I/O, which played directly in my > suggestion as well, since ReadFile() will return immediately and then you > can use WaitForSingleObject() to wait for the reading to signal the event > object that you place in your OVERLAPPED structure. > > > Gambit > >
Technical Details
Message-ID:
<427fd0af@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!transit0.news.tiscali.nl!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<427fa27e@newsgroups.borland.com> <vugv711ona1kdbekucqqkg6csqkcd4agrd@4ax.com> <427fca8b$1@newsgroups.borland.com> <427fce92$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,369fa724017da622 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Neil P." <nporve01@hotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <427fa27e@newsgroups.borland.com> <vugv711ona1kdbekucqqkg6csqkcd4agrd@4ax.com> <427fca8b$1@newsgroups.borland.com> <427fce92$1@newsgroups.borland.com> Subject: Re: Response not in que? Date: Mon, 9 May 2005 16:57:43 -0400 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 68.209.111.59 Message-ID: <427fd0af@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1115672751 68.209.111.59 (9 May 2005 14:05:51 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!transit0.news.tiscali.nl!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail