Aleksey Potjomkin wrote:
> Hello !
> 
>    I'm really sorry about that information. In the end of Execute
> method of thread i did "delete CPing". That was my fault.  Now it
> stucks at: "CPing->DnsLookup(g_strCurHost);"
> And nothing happening. Event
> "CPingDnsLookupDone"
> doesn't want to work, however i did :
> "CPing->OnDnsLookupDone = CPingDnsLookupDone;"
>   Why thats happening ?

Aleksey,

I haven't looked at the source, but usually a working message pump
is required in a worker thread to make asynchronous events working.
That most likely applies to the Ping-component as well, however I'm
not quite sure since I've never been using this component.

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
   

> 
> ----
> ProgMaster
> 
> 
> 
> 
> 
>> From: "Aleksey Potjomkin" <[EMAIL PROTECTED]>
>> Reply-To: ICS support mailing <twsocket@elists.org>
>> To: twsocket@elists.org
>> Subject: [twsocket] Troubles with using TPing in multithreaded
>> apps(DnsLookupDone error)
>> Date: Fri, 05 Jan 2007 16:10:20 +0200
>> 
>> 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
> 
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search!
> http://search.msn.com/
-- 
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