<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE TIP SYSTEM "http://www.tcl.tk/cgi-bin/tct/tip/tipxml.dtd">
<!-- Converted at Thu May 17 03:00:07 GMT 2012 -->
<!-- TIP AutoGenerator - written by Donal K. Fellows -->

<TIP number='130'>
<header><title>Unique DDE server names.</title><author address="mailto:patthoyts@users.sourceforge.net">Pat Thoyts</author><status type='project' state='final' tclversion="8.5" vote='after'>$Revision: 1.4 $</status><history></history><created day='23' month='mar' year='2003' /></header>
<abstract>The <emph style="italic">dde</emph> package server registration code should ensure that the server names are unique. The proposed changes will mean end-user visible changes for some scripts.</abstract>
<body><section title="Rationale">
<para>This TIP is really driven by Bug 219293 [<url ref="http://sf.net/tracker/?func=detail&amp;aid=219293&amp;group_id=10894&amp;atid=110894"/>]</para>
<para>The DDE system actually identifies servers by combination of window ID and a service and topic string identifier. There is nothing to prevent multiple servers having the same string identifiers but it is then a problem to determine which server you need to communicate with.</para>
<para>The <emph style="italic">tk appname</emph> command handles a similar situation by making the name unique during registration by appending a numerical suffix to the suggested name and then returning the name registered as the result of the command.</para>
</section>
<section title="Proposed Changes">
<para>This TIP proposes to use the <emph style="italic">tk appname</emph> unique name algorithm within the DDE server-name registration code. This TIP also proposes a <emph style="italic">-force</emph> option to this command to force the suggested name to be registered. The <emph style="italic">-force</emph> option would then provide the current registration scheme.</para>
</section>
<section title="Reference Implementation">
<para>See the patch attached to SF patch 690354 [<url ref="https://sourceforge.net/tracker/?func=detail&amp;aid=690354&amp;group_id=10894&amp;atid=310894"/>]</para>
</section>
<section title="Consequences">
<para>Firstly the <emph style="italic">dde servername</emph> command may register a different name than that provided to the command. Scripts will need to check the name actually registered by either maintaining the result of this command, or by executing the <emph style="italic">dde servername</emph> command without any arguments. This may impact scripts that assume the supplied argument was in fact the name registered.</para>
<para>Secondly, the name registration code must obtain a list of the dde server names currently registered on the system. It can do this by effectively calling <emph style="italic">dde services TclEval</emph>. In previous versions of the <emph style="italic">dde</emph> package there is a potential for the <emph style="italic">dde services</emph> command to hang in the presence of applications that are not processing messages. However, this issue has been addressed by Bug 707822&apos;s resolution.</para>
</section>
<section title="Copyright">
<para>This document is hereby placed in the public domain.</para>
</section>
</body></TIP>

