WSAAsyncGetHostByName takes quite long to return even on LAN

This is a discussion on WSAAsyncGetHostByName takes quite long to return even on LAN within the Networking/Device Communication forums, part of the General Programming Boards category; it takes lesser than 10 sec for ping.exe to have a reply from a local network computer connected together via ...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    114

    WSAAsyncGetHostByName takes quite long to return even on LAN

    it takes lesser than 10 sec for ping.exe to have a reply from a local network computer connected together via a hub

    for WSAAsyncGetHostByName , it takes up to 3-4 seconds to return.

    hmm... this kinda suxs because i cant use for games where instantenous response is needed

    anyone know why WSAAsyncGetHostByName takes so long to callback??

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Because it has to do a lookup to get the address every time.

    You should really store the address and use that instead.

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    21
    network name resolution is not deterministic ,
    it strats off looking in etc/hosts and then local/global dns.
    if u r sure make a cache to store resolved names for a while.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 03-10-2008, 11:57 AM
  2. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 07:05 AM
  3. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 01:39 PM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21