Article View: borland.public.cppbuilder.nativeapi
Article #6092Re: select() on serial port
From: Patrick Rotsaert
Date: Wed, 08 Jun 2005 14:11
Date: Wed, 08 Jun 2005 14:11
29 lines
1975 bytes
1975 bytes
Sounds promising! Do you know of any good examples on overlapped IO, events and such. Reading the microsoft help does not make it any easier ;-) Thanks, Patrick. Eelke wrote: > Patrick Rotsaert wrote: > >> While porting a unix application to win32, I found that the select() >> function only operates on sockets. >> My application uses both sockets and serial ports. Is there a proper >> way to wait for events on both socket and serial port at the same >> time, in the same thread? >> > Yes but it is slighly more complex then a simple select. > > Use overlapped IO for the serial communications. When using overlapped > IO you can specify an event which has to be signaled when the operation > completes. > > Using the function WSAEventSelect you can bind another event to network > events of the socket. > > Finally you can use WSAWaitForMultipleEvents to wait on both event objects. > > Eelke >
Technical Details
Message-ID:
<42a6fc95$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42a6eb15$3@newsgroups.borland.com> <42a6f1f5$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,be0dfdb43d2d029e X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 08 Jun 2005 16:11:32 +0200 From: Patrick Rotsaert <patrick.rotsaert@tts-online.be> User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: select() on serial port References: <42a6eb15$3@newsgroups.borland.com> <42a6f1f5$1@newsgroups.borland.com> In-Reply-To: <42a6f1f5$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 194.7.45.88 Message-ID: <42a6fc95$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1118239893 194.7.45.88 (8 Jun 2005 07:11:33 -0700) Lines: 30 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail