Results 1 to 2 of 2

Thread: Dns.Resolve too slow

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Location
    Porto Alegre, RS
    Posts
    210

    Dns.Resolve too slow

    in this code:

    VB Code:
    1. Try
    2.       client = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
    3.       port = RemotePort
    4.       ipHostInfo = Dns.Resolve(RemoteHostName)
    5.       ipAddress = ipHostInfo.AddressList(0)
    6.       Dim remoteEP As New IPEndPoint(ipAddress, port)
    7.       client.BeginConnect(remoteEP, AddressOf sockConnected, client)
    8.     Catch
    9.       RaiseEvent onError(index, Err.Description)
    10.       Exit Sub
    11.     End Try

    the line 'ipHostInfo = Dns.Resolve(RemoteHostName)' takes about 5 seconds to do it. anybody knows how can i take it of?

    i am working only with ip address, so i don't need to resolve it.

    Thank you,
    Guilherme Costa

  2. #2
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    Dns.Resolve does seem to be a little slow. I'm wondering why you need it. Unless you're using it somewhere else, your code doesn't seems to need it as you start off with the ip address anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width