Thanks Arno, I followed your advices and successfully solved both issues.
Regarding timer I'll try ThreadTimer as I don't need precise resolution here
--
Anton
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Anton S. wrote:
> 2Arno
>
>> Method DnsLookup doesn't require a custom timeout since the
>> underlaying winsock function uses system's DNS lookup timeout. Same
>> for Connect with or without DNS name.
>> And if method Connect is called with a DNS name it performs a
>> blocking DNS lookup while a B
> Yes, this is blocking DNS lookup which I want to avoid. And I
> dislike relying on OS timeouts, maybe it'll be 5 minutes long?
There is nothing you can do to speed-up or stop the DNS or connection
timeouts, they are specified in the registry. Even if you abort the
component on a timer, you can
2Arno
>Method DnsLookup doesn't require a custom timeout since the underlaying
>winsock function uses system's DNS lookup timeout. Same for Connect
>with or without DNS name.
>And if method Connect is called with a DNS name it performs a blocking
>DNS lookup while a Built-In timeout won't trigger
Anton S. wrote:
> 1) In my descendant class I implement true asynchronous Connect with
> asynchronous DNS lookup before connecting.
Method DnsLookup doesn't require a custom timeout since the underlaying
winsock function uses system's DNS lookup timeout. Same for Connect
with or without DNS name
Regarding accepted sockets: that's how I solved the problem for now:
procedure TServer.TriggerClientConnect(Client: TWSocketClient; Error: Word);
begin
inherited;
if Error <> 0 then Exit;
with TSrvClient(Client) do
begin
TimeoutSampling := 1000;
TimeoutConnect := InactiveTimeout;