Re: Event on modem or virtual serial port
Re: Event on modem or virtual serial port
- Subject: Re: Event on modem or virtual serial port
- From: Eli Bach <email@hidden>
- Date: Tue, 25 Nov 2008 23:09:00 -0800
On Nov 25, 2008, at 10:24 PM, Rakesh Singhal wrote:
Hi all
I want to get the notification for event on virtual serial (modem)
port. I am using select() API to polling on it. I get notification in
this case, but if I do not read the data or reading handling thread is
busy, then also it keeps giving notification that data is there. I
want to get the notification only when there any new event happen or
new data comes.
Please suggest me to resolve the issue.
Keep track of it yourself then. Set a flag in your own code when
select() tells you the serial port has data that your 'worker' thread
checks/clears before it goes idle, then stop passing that port to
select() until your worker thread clears that flag. Waking up
select() to re-add the port when the worker thread goes idle is left
as an exercise for the reader.
Eli
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden