diff --git a/mixer/src/Mixer.C b/mixer/src/Mixer.C index d142593..779de8a 100644 --- a/mixer/src/Mixer.C +++ b/mixer/src/Mixer.C @@ -100,19 +100,29 @@ Mixer::reply_to_finger ( lo_message msg ) int argc = lo_message_get_argc( msg ); lo_arg **argv = lo_message_get_argv( msg ); - if ( argc < 1 ) - return; + if ( argc >= 4 ) + { + const char *url = &argv[0]->s; + const char *name = &argv[1]->s; + const char *version = &argv[2]->s; + const char *id = &argv[3]->s; - lo_address to = lo_address_new_from_url( &argv[0]->s ); + MESSAGE( "Discovered NON peer %s (%s) @ %s with ID \"%s\"", name, version, url, id ); + MESSAGE( "Registering Signals" ); - osc_endpoint->send( to, - "/non/hello", - osc_endpoint->url(), - APP_NAME, - VERSION, - instance_name ); - - lo_address_free( to ); + lo_address to = lo_address_new_from_url( &argv[0]->s ); + + osc_endpoint->send( to, + "/non/hello", + osc_endpoint->url(), + APP_NAME, + VERSION, + instance_name ); + + mixer->osc_endpoint->hello( url ); + + lo_address_free( to ); + } } void diff --git a/mixer/src/NSM.C b/mixer/src/NSM.C index 33d8b6d..491d177 100644 --- a/mixer/src/NSM.C +++ b/mixer/src/NSM.C @@ -43,7 +43,7 @@ NSM_Client::command_broadcast ( const char *path, lo_message msg ) int argc = lo_message_get_argc( msg ); // lo_arg **argv = lo_message_get_argv( msg ); - if ( argc == 1 && !strcmp( path, "/non/finger" ) ) + if ( !strcmp( path, "/non/hello" ) ) { mixer->reply_to_finger( msg ); return 0; diff --git a/mixer/src/main.C b/mixer/src/main.C index 5150593..f0ce456 100644 --- a/mixer/src/main.C +++ b/mixer/src/main.C @@ -285,6 +285,8 @@ main ( int argc, char **argv ) } } + mixer->say_hello(); + Fl::add_check( check_sigterm ); Fl::run(); diff --git a/timeline/src/NSM.C b/timeline/src/NSM.C index 4b47e92..af0ee08 100644 --- a/timeline/src/NSM.C +++ b/timeline/src/NSM.C @@ -99,7 +99,7 @@ command_broadcast ( const char *path, lo_message msg, void *userdata ) int argc = lo_message_get_argc( msg ); // lo_arg **argv = lo_message_get_argv( msg ); - if ( argc == 1 && !strcmp( path, "/non/finger" ) ) + if ( !strcmp( path, "/non/hello" ) ) { timeline->reply_to_finger( msg ); return 0; diff --git a/timeline/src/Timeline.C b/timeline/src/Timeline.C index c4779b4..e7f50d0 100644 --- a/timeline/src/Timeline.C +++ b/timeline/src/Timeline.C @@ -1755,6 +1755,8 @@ Timeline::reply_to_finger ( lo_message msg ) VERSION, instance_name ); + osc->hello( &argv[0]->s ); + lo_address_free( reply ); } @@ -1787,12 +1789,14 @@ Timeline::discover_peers ( void ) { lo_message m = lo_message_new(); - lo_message_add_string( m, "/non/finger" ); - lo_message_add_string( m, osc->url() ); - - nsm_send_broadcast( nsm, m ); + lo_message_add( m, "sssss", + "/non/hello", + osc->url(), + APP_NAME, + VERSION, + instance_name ); - lo_message_free( m ); + nsm_send_broadcast( nsm, m ); } }