diff options
author | fcolin | 2007-02-01 12:55:56 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 12:55:56 +0000 |
commit | b18dd91d7868c46f8ee0464838d3b0380fed643c (patch) | |
tree | be32bb3a5c0fdce3216797bdf0cd5c3330ca9205 | |
parent | 71c03f5f23aae4165215b46d5e0e4763e889ae2c (diff) | |
download | ivy-cplusplus-b18dd91d7868c46f8ee0464838d3b0380fed643c.zip ivy-cplusplus-b18dd91d7868c46f8ee0464838d3b0380fed643c.tar.gz ivy-cplusplus-b18dd91d7868c46f8ee0464838d3b0380fed643c.tar.bz2 ivy-cplusplus-b18dd91d7868c46f8ee0464838d3b0380fed643c.tar.xz |
Utilisateur : Fcolin Date : 25/10/01 Heure : 18:39 Archivé dans $/Ivy (vss 10)
-rw-r--r-- | Bus/Ivy/Ivy.cxx | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/Bus/Ivy/Ivy.cxx b/Bus/Ivy/Ivy.cxx index c56356c..3906333 100644 --- a/Bus/Ivy/Ivy.cxx +++ b/Bus/Ivy/Ivy.cxx @@ -83,7 +83,7 @@ const char * Ivy::GetDomain(const char *domainlist) }
if ( domain.empty() )
{
-#ifdef _WIN_CE
+#ifndef _WIN_CE
const char *env = getenv ( "IVYBUS" );
if ( env )
domain = env;
@@ -210,19 +210,44 @@ void Ivy::SendSubscriptions(IvyApplication *app) }
-int Ivy::SendMsg(const char * message)
+int Ivy::SendMsg(const char * message, ... )
{
int count = 0;
+ char buffer[4096];
+ va_list args;
+
+ va_start( args, message ); /* Initialize variable arguments. */
+ vsprintf( buffer, message, args );
+ va_end( args);
/* send to already connected */
IvyApplicationList::iterator iter;
for ( iter = applications.begin() ; iter != applications.end() ; ++iter )
{
IvyApplication *app = *iter;
- count += app->SendMsg( message );
+ count += app->SendMsg( buffer );
}
return count;
}
-
+void Ivy::SendDieMsg( IvyApplication *app )
+{
+ app->SendMsg( IvyApplication::Die, 0 );
+}
+IvyApplication * Ivy::GetApplication(const char *name)
+{
+ EnterCriticalSection( &m_application_cs );
+ IvyApplicationList::iterator iter;
+ for ( iter = applications.begin() ; iter != applications.end() ; )
+ {
+ IvyApplication *app = *iter++;
+ if ( (app->m_hSocket != INVALID_SOCKET) && app->appname == name )
+ {
+ return app;
+ }
+ }
+ LeaveCriticalSection( &m_application_cs );
+ return NULL;
+}
+
void Ivy::CallMessageCallback(IvyApplication *app, int id, int argc, const char ** argv)
{
|