I’m trying to write a Bluetooth server as a MFC app and while I got it working as a console app with blocking sockets, I can’t get it working using CAsyncSocket.
The error it returns is 10035 – WSAEWOULDBLOCK as soon as I call Accept()
I could copy the code, but it’s way too long, so I’ll just outline the general idea:
– create, bind regular socket and start listening just like in the Microsoft SDK example app
– attach this socket to CAsyncSocket
– call Accept() (this is where the error occurs)
Any ideas how to get Bluetooth working with CAsyncSocket?
Thanks, I’ve corrected that, but OnAccept, OnConnect(), etc. were never executed, not even when called directly. It turned out that I had to delete all the temporary files the compiler and linker use to find out that I was using global shorthand function log() which clashed with log() defined in math.h and which caused some weird behavior.
See this thread for more datails http://www.codeguru.com/forum/showthread.php?t=339413
UPDATE: now you can download the finished app and the whole source code on Brm Bluetooth Remote Control homepage!