🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3478

Re: Com port error

#3478
From: Remy Lebeau (TeamB)
Date: Sat, 17 Jun 2006 21:29
28 lines
2108 bytes
"JD" <nospam@nospam.com> wrote in message
news:44944f06@newsgroups.borland.com...

> I'm not sure exactly. I think it had something to do with
> fear that the thread would get deadlocked if no data ever
> came across.

That is what Overlapped I/O is for.  Besides that, you can alternatively use
SetCommTimeouts() to set the reading/writing timeouts on the COM port so
that code cannot deadlock forever.

> I haven't researched it yet but ISTM that unless one can set
> a timeout for WaitCommEvent, the thread won't ever terminate.

You would need to use Overlapped I/o in order for WaitCommEvent() to support
a timeout.

> I've looked at both links yes (thank you), but I still can't
> get a simple test to work!

What EXACTLY have you tried so far that does not work for you?  I find those
articles, especially "Serial Communications in Win32", to be very useful.
I've written entire reading/writing schemes based on the information in that
one article.


Gambit
Technical Details
Message-ID: <449474a6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4491a4c2$1@newsgroups.borland.com> <4491a6b2$1@newsgroups.borland.com> <4492cbf9$1@newsgroups.borland.com> <4492e2ca$1@newsgroups.borland.com> <44944f06@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f1782b94b4ced041
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4491a4c2$1@newsgroups.borland.com> <4491a6b2$1@newsgroups.borland.com> <4492cbf9$1@newsgroups.borland.com> <4492e2ca$1@newsgroups.borland.com> <44944f06@newsgroups.borland.com>
Subject: Re: Com port error
Date: Sat, 17 Jun 2006 14:29:58 -0700
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <449474a6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1150579878 68.69.17.41 (17 Jun 2006 14:31:18 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail