diff options
author | fcolin | 2007-02-01 12:56:24 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 12:56:24 +0000 |
commit | 9cc867ca9b6d5d05f51d4f736d511ca99da268e3 (patch) | |
tree | fd99168f21e4911a08825755978fdda86b1242c0 /Bus | |
parent | e16c67dbbecb836c1b61019b58155951baaa60eb (diff) | |
download | ivy-cplusplus-9cc867ca9b6d5d05f51d4f736d511ca99da268e3.zip ivy-cplusplus-9cc867ca9b6d5d05f51d4f736d511ca99da268e3.tar.gz ivy-cplusplus-9cc867ca9b6d5d05f51d4f736d511ca99da268e3.tar.bz2 ivy-cplusplus-9cc867ca9b6d5d05f51d4f736d511ca99da268e3.tar.xz |
Utilisateur : Fcolin Date : 23/05/06 Heure : 18:18 Archivé dans $/Bus/Ivy Commentaire: Modification protocol UDP (vss 24)
Diffstat (limited to 'Bus')
-rw-r--r-- | Bus/Ivy/Ivy.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Bus/Ivy/Ivy.cxx b/Bus/Ivy/Ivy.cxx index 49be33b..66c1715 100644 --- a/Bus/Ivy/Ivy.cxx +++ b/Bus/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];
|