Arno Garrels wrote:
> The DLL names are globally writable typed constants, set their values
> before the OpenSSL libraries are loaded.
Is there any advantage to use writable typed constants like
const GSSLEAY_DLL_Name : String = 'SSLEAY32.DLL';
instead of
var GSSLEAY_DLL_Name : String = 'SSLEAY32.DLL';
?
Both seems to work but I try to avoid the first one whenever possible because
it can break multi-threading when not used properly. For example I had a
commercial component that contained code like this to save some code lines:
procedure SomeProc();
{$J+} // enable writeable consts
const
Buffer : array[0..31] of byte = (0, 0, ..., 0);
{$J-} // disable writeable consts
begin
// read and write to Buffer like it's a variable
end;
which caused problems when the procedure is used by different threads
simultaneously because all instances read and write to the same block in
memory.
I know this is not a problem with ICS but I wonder why writable consts are
used/preferred at all.
Regards,
Tobias
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be