resolving = blocking?
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?
Yeah it blocks and there''s not really anything you can do about it in standard sockets. On Windows you can use WSAAsyncGetHostByName.
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+)
- 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+)
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement