Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Event on modem or virtual serial port




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:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >Event on modem or virtual serial port (From: "Rakesh Singhal" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.