summaryrefslogtreecommitdiff
path: root/Ivy/Ivy.cxx
diff options
context:
space:
mode:
authorfcolin2007-02-01 12:56:24 +0000
committerfcolin2007-02-01 12:56:24 +0000
commit4012d9d589b8063a57be612b913dfa7270f5a017 (patch)
tree00834a98ec66edacc0a4574305b21c8ff149dbce /Ivy/Ivy.cxx
parente5faff1c9281641151f0fb6cff53d223fc1d1b91 (diff)
downloadivy-cplusplus-4012d9d589b8063a57be612b913dfa7270f5a017.zip
ivy-cplusplus-4012d9d589b8063a57be612b913dfa7270f5a017.tar.gz
ivy-cplusplus-4012d9d589b8063a57be612b913dfa7270f5a017.tar.bz2
ivy-cplusplus-4012d9d589b8063a57be612b913dfa7270f5a017.tar.xz
Utilisateur : Fcolin Date : 23/05/06 Heure : 18:18 Archivé dans $/Bus/Ivy Commentaire: Modification protocol UDP (vss 24)
Diffstat (limited to 'Ivy/Ivy.cxx')
-rw-r--r--Ivy/Ivy.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/Ivy/Ivy.cxx b/Ivy/Ivy.cxx
index 49be33b..66c1715 100644
--- a/Ivy/Ivy.cxx
+++ b/Ivy/Ivy.cxx
@@ -61,7 +61,7 @@ Ivy::Ivy(const char* name, const char * ready, IvyApplicationCallback *callback,
if ( synchronous )
IvySynchronousCallback::m_synchro = new IvySynchroWnd();
ready_message = ready;
- appname = name;
+ ApplicationName = name;
messages_classes_count = 0;
messages_classes = NULL;
application_callback = synchronous ? new IvySynchronousApplicationCallback(callback) : callback;
@@ -74,10 +74,21 @@ Ivy::Ivy(const char* name, const char * ready, IvyApplicationCallback *callback,
TRACE( " Can't Create server %d\n", server->GetLastError( ) );
return;
}
+ ApplicationID = GenApplicationUniqueIdentifier();
watcher = new IvyWatcher(this);
}
+const char *Ivy::GenApplicationUniqueIdentifier()
+{
+ static char appid[2048];
+ long curtime;
+ curtime = GetTickCount();
+ srand( curtime );
+ sprintf(appid,"%d:%ld:%d",rand(),curtime,applicationPort);
+ return appid;
+}
+
const char * Ivy::GetDomain(const char *domainlist)
{
// determine domain to use
@@ -232,7 +243,7 @@ void Ivy::RemoveApplication(IvyApplication * app)
void Ivy::SendSubscriptions(IvyApplication *app)
{
- app->SendMsg( IvyApplication::StartRegexp, GetApplicationPort(), appname.c_str());
+ app->SendMsg( IvyApplication::StartRegexp, GetApplicationPort(), ApplicationName.c_str());
for ( unsigned int id = 0 ; id < regexp_out.size(); id++ )
{
const ivy::string& regexp = regexp_out[id];