Hi !

  I need to use TPing component for checking large lists of servers. So I've 
decided to use threads (i haven't find asynchronous functions like it was 
with TFTPCli), so this only way i know. I'll show some code so it will be 
easier to explain my problem. Here is thread Execute function (almost all):
"
  // [CPing initialization]
    CPing = new TPing(NULL);
    CPing->Timeout = StrToInt(fPinger->edTimeout->Text) * 1000;
    CPing->Size = StrToInt(fPinger->edPacketSize->Text);
    CPing->Flags = 0;
    CPing->TTL = 64;
    CPing->OnDisplay = CPingDisplay;
    CPing->OnDnsLookupDone = CPingDnsLookupDone;
    CPing->OnEchoReply = CPingEchoReply;
    CPing->OnEchoRequest = CPingEchoRequest;
    // [/CPing initialization]

    // ...here i is loading of server list...

   CPing->DnsLookup(g_strCurHost);
"
  Now its turn of CPingDnsLookupDone event:
"
   fPinger->Memo1->Lines->Add("Error= " + StrToInt(Error));  // to memo box 
added nothing, totally. i Even tried to do it with synchronize it not helps 
anyways.

  if(Error != 0)
      // unknown host
  else
{
  CPing->Address = CPing->DnsResult;
    CPing->Ping();
}
"
DnsResult is always 0.0.0.0 (just empty when im trying to print it).

  I don't know what to do with that. But i need your help to solve this 
problem.

---
With Respect,
Aleksey

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to