From 4012d9d589b8063a57be612b913dfa7270f5a017 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 12:56:24 +0000 Subject: Utilisateur : Fcolin Date : 23/05/06 Heure : 18:18 Archivé dans $/Bus/Ivy Commentaire: Modification protocol UDP (vss 24) --- Ivy/Ivy.cxx | 15 +++++++++++++-- 1 file 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]; -- cgit v1.1