|
From: Philippe M. <pm...@ac...> - 2010-02-28 12:05:08
|
Hi Cam, I thought including path and typespec might be useful when the same handler has been registered for multiple methods and one want to unregister it for only a given method. But I don't know if this is a need in real-life use cases. In my case, the simpler API you describe would be ok. Thx Phil Le 28 févr. 2010 à 11:37, Camille Troillard a écrit : > Hi Philippe, > > It looks like a sensitive idea. > I actually didn't know that it was possible to register multiple handlers for one method. > > Why not making the API as simple as : > > lo_server_del_method_handler (lo_server s, lo_method_handler h) > > I guess we just need to walk through the chain of handlers, and remove every occurrences of the one that we want. What do you think? > I am not sure why path and typespec would be needed, or maybe was it just a side effect of writing an email late a night? :-) > > > Best, > Cam > > > > On Sun, Feb 28, 2010 at 1:29 AM, Philippe Mougin <pm...@ac...> wrote: > Hi, > > Sometimes in my application I can have multiple different handlers registered for the same method. For example, I can be in a state similar by the one created by: > > lo_server_add_method(localOSCServer, "/foo/bar", "f", foo_handler, NULL); > lo_server_add_method(localOSCServer, "/foo/bar", "f", bar_handler, NULL); > > Now, I'd like to unregister bar_handler while keeping foo_handler registered. I don't see how to do that with the current API (seems that I can only remove the whole "/foo/bar" method with all associated handlers). > > I may well be overlooking something as I'm new to liblo (besides, it's 1 a.m.) > > If not, do you think it would be a good idea to extend the API with something like lo_server_del_method_handler (lo_server s, const char *path, const char *typespec, lo_method_handler h), which would remove h from the handlers associated with the given path/typespecs? > > Thanks, > > Philippe Mougin > http://www.fscript.org > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > liblo-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/liblo-devel > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev_______________________________________________ > liblo-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/liblo-devel |