resolving = blocking?

Started by
3 comments, last by foofightr 20 years, 11 months ago
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?
Advertisement
Yeah it blocks and there''s not really anything you can do about it in standard sockets. On Windows you can use WSAAsyncGetHostByName.
-Mike
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+)

[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com
The other way is to create your own DNS query procedure...

"I''ll be Bach!" (c) Johann Sebastian Schwarzenegger
"I'll be Bach!" (c) Johann Sebastian Schwarzenegger
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

This topic is closed to new replies.

Advertisement