Jump to content
  • Advertisement

Archived

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

foofightr

resolving = blocking?

This topic is 5550 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

gethostbyname() I don''t see anything in MSDN about this function blocking, but logically it has to, right? It has to go out from your computer, access a DNS server, and come back? I''m just concerned that if someone is runing my game and their connection is down, and they try to connect to a server using a "server.whatever.com" kinda address, it will freeze their program for X seconds?

Share this post


Link to post
Share on other sites
Advertisement
Yeah it blocks and there''s not really anything you can do about it in standard sockets. On Windows you can use WSAAsyncGetHostByName.

Share this post


Link to post
Share on other sites
The alternatives:

- queue a user APC to a separate thread and when the APC is executed, perform the blocking call there.

- queue a work item to the process'' thread pool (under Windows 2000+)

Share this post


Link to post
Share on other sites
The other way is to create your own DNS query procedure...

"I''ll be Bach!" (c) Johann Sebastian Schwarzenegger

Share this post


Link to post
Share on other sites
Thanks for the answers. Since I don''t particularly care for the methods suggested, I''ve decided that you''ll just have to enter direct IP addresses in my game

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!