PDA

View Full Version : PPC C++ Socket question


kireol
13th March 2008, 04:07 AM
I'm writing an app in MS VS 8 C++. it's for Windows Mobile. Making it to run on my Tilt.

I seem to have my code 90% there. I'm stuck on 1 last thing. I made 3 functions "handleData", "sendData", and "InitSocket".

Initsocket gets called in WinMain. works perfectly.
sendData gets called in a few places. Works perfectly.
handleData - which will process reads and closes, etc looks like it will work, but I still don't know how to call this function.

Is there a WM_XXXXX event or something that I can call my handleData with? something like a WM_SOCKET that works with a PPC? If not, how do I know when to call my handleData function?

Koterpillar
13th March 2008, 09:37 AM
No, there is none, you totally confuse what windows messages (WM_XXXX) are with sockets. You should call recv() on the socket and wait. Either do that on a separate thread, or via timer (and then make it non-blocking).