Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Galileo430

CAsyncSocket again

This topic is 6305 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here it goes.. For some reason.. Whenever I''m in a function or the focus is not set on the main window.. It refuses to receive messages. Anyone else have this problem, or know how to fix it?

Share this post


Link to post
Share on other sites
Advertisement
Why do I think you need to multithread your app...?

In a single execution thread application, calling a function routes all processor time devoted to your function there. Even under Windows, your message loop is exactly that - a simple loop that handles incoming messages. You then try to respond to them as quickly as possible so as not to hold up the whole system. If you want to be able to call functions at will while responding to socket messages/connections/transmissions/whatever, you''re gonna need to place your socket code in a child thread.

I haven''t used CAsyncSocket (because I''m trying to write something reasonably portable here), but is it multithreaded? ie, does it somehow encapsulate a CThread object?

Good luck. I''ll let you know what I come up with.

Share this post


Link to post
Share on other sites
Well, the problem is (I think) that because the socket is derived from a window handle it only that windows message loop can receve the data.

So I think I need a manual way to trigger that Windows message loop so it can call CAsyncSocket::OnRecieve()

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!