[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: selecting sockets and serials
- From: "Thijs Schreijer" <thijs@...>
- Date: Tue, 16 Oct 2012 08:35:41 +0200
> On Behalf Of steve donovan
> Sent: dinsdag 16 oktober 2012 7:56
> Subject: Re: selecting sockets and serials
>
> On Mon, Oct 15, 2012 at 11:39 PM, Thijs Schreijer
> <thijs@thijsschreijer.nl> wrote:
> >
> > So far I've been using visual studio, but would switching to cygwin
> or
> > the likes be a workaround to make it work on windows?
>
> One way would be to use an async serial interface. Winapi has a simple
> one:
>
> http://stevedonovan.github.com/winapi/api.html#open_serial
>
> It returns a File object which has a read_async method (backed by a
> thread)
>
> Not _exhaustively_ tested, so your milleage may vary ;)
>
> steve d.
Thx for that. A need to use both sockets and a serial connection, and my
preferred way would be to use a single select statement so the whole thing
goes into a waitstate. If I use serial and sockets from different libraries
I have to use a loop.
So if cygwin doesn't handle that, then using a loop; what is the common
interval to poll sockets and serial, that works best yet minimizes the cpu
usage (busy-wait)
Thijs