Re: WriteSync / WriteAsync
Re: WriteSync / WriteAsync
- Subject: Re: WriteSync / WriteAsync
- From: Joseph Kelly <email@hidden>
- Date: Wed, 9 May 2007 16:03:13 -0700
On May 9, 2007, at 2:09 PM, Moritz Gmelin wrote:
2. Is Write Async as safe as write sync ? Event when not
implementing the callback methods ?
If you don't implement the callback, you won't get write error
notifications. You'll want those.
If you find you have no workaround, then you can "fake" a synchronous
operation by issuing the async command, then adding a timer to the
current run loop, then run the run loop in a custom mode (i.e. a mode
you don't use anywhere else in your program). From your async
complete method, you remove the timer from the runloop, and voila.
This gives you the added benefit that you can implement a time out
using the timer.
Joe K.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden