Article View: borland.public.cppbuilder.nativeapi
Article #6091Re: select() on serial port
From: Eelke
Date: Wed, 08 Jun 2005 13:27
Date: Wed, 08 Jun 2005 13:27
19 lines
1695 bytes
1695 bytes
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:
<42a6f1f5$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.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>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 15:27:20 +0200 From: Eelke <e.klein@mplussoftware.nl> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) 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> In-Reply-To: <42a6eb15$3@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.58.1.162 Message-ID: <42a6f1f5$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1118237173 81.58.1.162 (8 Jun 2005 06:26:13 -0700) Lines: 19 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.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