Re: RFCOMM Channel Read/Write timeout strategy?
Re: RFCOMM Channel Read/Write timeout strategy?
- Subject: Re: RFCOMM Channel Read/Write timeout strategy?
- From: Marco Pontil <email@hidden>
- Date: Thu, 29 Sep 2005 17:20:53 -0700
Because RFCOMM implements a flow control, there is the possibility
that the other side does not empty its queue blocking the data send.
So it is possible that data does not go over the air (and you do not
get a notification for it).
This is really an unlikely event, but if you think it can happen
starting a NSTimer may be worth doing.
... Marco
On Sep 29, 2005, at 5:07 PM, Joseph Kelly wrote:
If you issue an RFCOMM write call, the data will be delivered
unless the connection is terminated. Unless there are horrible
radio conditions, it seems unlikely to take very long before the
write completes and you callback is called. Are you having
specific problems with writes taking too long to complete?
None so far. I'm just planning for the worst-case.
In answer to your question, your best bet is probably to create an
NSTimer with the timeout that you want. Then in your callback,
yoou can invalidate the timer if it hasn't fired. With that
model, there is no need to block your main thread. Either the
timer will fire, or you will get your write callback called.
Thanks. I'm still deciding exactly how to arrange my code. I'm in a
bind that I must design my bluetooth code to plug into a cross
platform application that's expecting a particular interface and
also be exported as a bundle that's loaded into a CFM application.
joe
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_______________________________________________
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