i want to create a non-blocking OBEX connection for my application Series60-Remote.
I read on your Website "If you want the normal Cocoa asynchronous behaviour that doesn't freeze, use the LightAquaBlue framework and Apple's IOBluetooth framework through PyObjC instead"
Check the source code for OBEXClient in src/mac/_obex.py. It uses the BBBluetoothOBEXClient class from the LightAquaBlue framework to run an OBEX client. Whenever it starts an operation (connect, put, etc.) it calls _macutil.waituntil() which basically blocks until the client finishes the request. If you don't call _macutil.waituntil(), it won't block, and you've got yourself an asynchronous client. Of course, if you don't call _macutil.waituntil(), you'll have to start the event loop yourself through pyobjc.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
i want to create a non-blocking OBEX connection for my application Series60-Remote.
I read on your Website "If you want the normal Cocoa asynchronous behaviour that doesn't freeze, use the LightAquaBlue framework and Apple's IOBluetooth framework through PyObjC instead"
So I tried the following code.
But this didn't work, I get the following error:
Do you know what I've done wrong?
Are there any exapmes for such an OBEX connection?
Thanks for any help,
Lukas Hetzenecker
Check the source code for OBEXClient in src/mac/_obex.py. It uses the BBBluetoothOBEXClient class from the LightAquaBlue framework to run an OBEX client. Whenever it starts an operation (connect, put, etc.) it calls _macutil.waituntil() which basically blocks until the client finishes the request. If you don't call _macutil.waituntil(), it won't block, and you've got yourself an asynchronous client. Of course, if you don't call _macutil.waituntil(), you'll have to start the event loop yourself through pyobjc.