> Assign something on the OnError is not the way to go. Should the
> RaiseException line not be commented out ? What do you think ?

The code is OK for both those using OnError and those using exception handling, 
IMO.

--
[EMAIL PROTECTED]
http://www.overbyte.be


----- Original Message ----- 
From: "Wilfried Mestdagh" <[EMAIL PROTECTED]>
To: <twsocket@elists.org>
Sent: Wednesday, August 17, 2005 11:57 AM
Subject: [twsocket] TWSocket DNSLookup


> Hello Francois,
> 
> Strange after all these years I did not check the AHostName before
> calling DNSLookup for the first time :)
> 
> Anyway there is something I wonder. First exception is raised, then
> TriggerDnsLookupDone is called with the right argument, however because
> the exception it is never called, and it should be with or without
> error.
> 
> Assign something on the OnError is not the way to go. Should the
> RaiseException line not be commented out ? What do you think ?
> 
> procedure TCustomWSocket.DnsLookup(const AHostName : String);
> var
>     IPAddr   : TInAddr;
>     HostName : String;
> begin
>     if AHostName = '' then begin
>         RaiseException('DNS lookup: invalid host name.'); // comment ?
>         TriggerDnsLookupDone(WSAEINVAL);
>         Exit;
>     end;
> 
> --
> Rgds, Wilfried
> http://www.mestdagh.biz
> 
> -- 
> 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
-- 
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