diff options
author | fcolin | 2007-02-01 12:59:43 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 12:59:43 +0000 |
commit | 16a071fea1a2c33d03b8c9c86661012e13642c91 (patch) | |
tree | 026d24b48876e586358d3e57ebfbcca4b3166d2a /Bus/Ivy/IvyApplication.cxx | |
parent | cbbe6d470651592373700187e32425fdb0b5ef57 (diff) | |
download | ivy-cplusplus-16a071fea1a2c33d03b8c9c86661012e13642c91.zip ivy-cplusplus-16a071fea1a2c33d03b8c9c86661012e13642c91.tar.gz ivy-cplusplus-16a071fea1a2c33d03b8c9c86661012e13642c91.tar.bz2 ivy-cplusplus-16a071fea1a2c33d03b8c9c86661012e13642c91.tar.xz |
Utilisateur : Fcolin Date : 14/02/01 Heure : 18:47 Archivé dans $/Ivy (vss 8)
Diffstat (limited to 'Bus/Ivy/IvyApplication.cxx')
-rw-r--r-- | Bus/Ivy/IvyApplication.cxx | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/Bus/Ivy/IvyApplication.cxx b/Bus/Ivy/IvyApplication.cxx index cbb3ee6..ef72bd1 100644 --- a/Bus/Ivy/IvyApplication.cxx +++ b/Bus/Ivy/IvyApplication.cxx @@ -11,7 +11,7 @@ #include "IvyApplication.h"
#include "Regexp.h"
-//#define DEBUG
+#define IVY_DEBUG
#define ARG_START "\002"
#define ARG_END "\003"
@@ -61,7 +61,7 @@ UINT IvyApplication::Create() Listen( SOMAXCONN );
GetSockName( host, port );
TRACE(" TCP %s:%d\n", host.c_str(), port );
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE( "IvyApplication::Create server socket %d\n", m_hSocket );
#endif
return port;
@@ -78,9 +78,9 @@ void IvyApplication::OnReceive(char * line) const char *argv[Regexp::NSUBEXP];
char *arg;
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("Receive %s\n",line);
-#endif //DEBUG
+#endif //IVY_DEBUG
err = sscanf( line ,"%d %d", &kind_of_msg, &id);
arg = strstr( line , ARG_START );
@@ -97,31 +97,31 @@ void IvyApplication::OnReceive(char * line) {
case Bye:
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("Quitting %s\n", line);
-#endif //DEBUG
+#endif //IVY_DEBUG
// bus->RemoveApplication( this );
Close();
break;
case Error:
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("Receive error %d %s\n", id, arg);
-#endif //DEBUG
+#endif //IVY_DEBUG
break;
case AddRegexp:
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("Regexp id=%d exp='%s'\n", id, arg);
-#endif //DEBUG
+#endif //IVY_DEBUG
if ( !bus->CheckRegexp( arg ) )
{
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("Warning exp='%s' can't match removing from %s\n",arg,appname.c_str());
-#endif //DEBUG
+#endif //IVY_DEBUG
return;
}
exp = new Regexp( arg );
@@ -140,9 +140,9 @@ void IvyApplication::OnReceive(char * line) break;
case DelRegexp:
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("Regexp Delete id=%d\n", id);
-#endif //DEBUG
+#endif //IVY_DEBUG
if ( regexp_in[id] )
{
exp = regexp_in[ id ];
@@ -152,9 +152,9 @@ void IvyApplication::OnReceive(char * line) break;
case StartRegexp:
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("Regexp Start id=%d\n", id);
-#endif //DEBUG
+#endif //IVY_DEBUG
appname = arg;
/* remote socket port */
@@ -169,9 +169,9 @@ void IvyApplication::OnReceive(char * line) break;
case EndRegexp:
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("Regexp End id=%d\n", id);
-#endif //DEBUG
+#endif //IVY_DEBUG
bus->CallApplicationConnectedCallback( this );
AppConnectedCallbackCalled = true;
@@ -180,9 +180,9 @@ void IvyApplication::OnReceive(char * line) break;
case Msg:
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("Message id=%d msg='%s'\n", id, arg);
-#endif //DEBUG
+#endif //IVY_DEBUG
arg = strtok( arg, ARG_END);
while ( arg )
@@ -194,17 +194,17 @@ void IvyApplication::OnReceive(char * line) break;
case DirectMsg:
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("Direct Message id=%d msg='%s'\n", id, arg);
-#endif //DEBUG
+#endif //IVY_DEBUG
bus->CallDirectMessageCallback( this, id, arg );
break;
case Die:
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("Die Message id=%d msg='%s'\n", id, arg);
-#endif //DEBUG
+#endif //IVY_DEBUG
if ( bus->CallDieCallback( this, id, arg ) )
{
@@ -227,9 +227,9 @@ void IvyApplication::SendMsg(MsgType msg, int id, const char * arg) sprintf( buffer, "%d %d" ARG_START "%s\n", msg, id, arg );
else sprintf( buffer, "%d %d" ARG_START "\n", msg, id );
-#ifdef DEBUG
+#ifdef IVY_DEBUG
TRACE("SendMsg %s\n",buffer);
-#endif //DEBUG
+#endif //IVY_DEBUG
Send( buffer );
}
|