summaryrefslogtreecommitdiff
path: root/Ivy/Ivy.cxx
diff options
context:
space:
mode:
authorfcolin2009-07-06 10:39:28 +0000
committerfcolin2009-07-06 10:39:28 +0000
commit879eaf77babef13084b95ef170742958d90389b6 (patch)
tree8b463f94cdbd4c170d9d9174ad8108c937b5bc7a /Ivy/Ivy.cxx
parentb62585c0d4dec9b1cec86f808b3d8b0eddd0437c (diff)
downloadivy-cplusplus-879eaf77babef13084b95ef170742958d90389b6.zip
ivy-cplusplus-879eaf77babef13084b95ef170742958d90389b6.tar.gz
ivy-cplusplus-879eaf77babef13084b95ef170742958d90389b6.tar.bz2
ivy-cplusplus-879eaf77babef13084b95ef170742958d90389b6.tar.xz
ajout IvyChangeMsg
correction pb latence TCP_NODELAY
Diffstat (limited to 'Ivy/Ivy.cxx')
-rw-r--r--Ivy/Ivy.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/Ivy/Ivy.cxx b/Ivy/Ivy.cxx
index 4564c6f..16b76b1 100644
--- a/Ivy/Ivy.cxx
+++ b/Ivy/Ivy.cxx
@@ -204,6 +204,28 @@ void Ivy::UnbindMsg(int id)
}
+void Ivy::ChangeBindMsg(int id, const char *regexp, ...)
+{
+ char buffer[4096];
+ char buffer2[8192];
+ va_list args;
+
+ va_start( args, regexp ); /* Initialize variable arguments. */
+ _vsnprintf_s( buffer, sizeof(buffer), sizeof(buffer)-1, regexp, args );
+ va_end( args);
+
+ SubstituteInterval( buffer, buffer2, sizeof( buffer2 ) );
+ regexp_out[ id ] = buffer2;
+ /* send to already connected */
+ IvyApplicationList::iterator iter;
+ for ( iter = applications.begin() ; iter != applications.end() ; ++iter )
+ {
+ IvyApplication *app = *iter;
+ app->SendMsg(IvyApplication::AddRegexp, id, buffer2 );
+ }
+
+}
+
void Ivy::BindDirectMsg(IvyDirectMessageCallback *callback)
{
direct_callback = callback;
@@ -230,6 +252,10 @@ void Ivy::AddApplication(IvyApplication *app)
}
applications.push_back( app );
LeaveCriticalSection( &m_application_cs );
+ // put the socket in NOdelay , disable Nagle's Algorithm
+ // we want Ivy Send message Immediately
+ int flag=1;
+ int err = app->SetSockOpt( TCP_NODELAY, &flag, sizeof(flag) );
SendSubscriptions( app );
}
void Ivy::RemoveApplication(IvyApplication * app)