|
From: Stephen S. <rad...@gm...> - 2016-04-04 13:38:51
|
Indeed, well I see the utility of this... I'm surprised the only thing you needed to change was passing an argument to getaddrinfo! Very clean, but the liblo API doesn't make it clean to add it. I would be more inclined perhaps to generalize it and add something that takes an already-allocated server port or addrinfo or something along those lines.. Also, a constructor for lo_server_thread taking a lo_server as argument should be publicly available now that I think about it. Possibly some kind of constructor taking a data structure with various options could be a useful next step, although the downside is that then there is a new data structure to maintain. (Currently liblo's API is function-based only.) Still, I wonder if server initialization should be split into 2 stages for the "low level" interface -- configuring server options, and then opening the actual server. Thinking wider, it's possibly time to start thinking about a liblo1 fork that breaks API/ABI compatibility. There are several things I would change. Unfortunately I don't think I have enough time to dedicate to it. Steve On Mon, Apr 4, 2016 at 6:19 AM, Erik Ronström <eri...@do...> wrote: > Here’s a patch, should anyone else be interested! > > Usage: > > lo_server_thread st = lo_server_thread_new_with_proto_and_node(”777”, LO_TCP, ”127.0.0.1”, err_handler); > > Adding yet another constructor to server and server_thread is perhaps not very elegant – a nicer solution would be to add a node parameter to all of the constructor functions, however that would obviously break backward compability. > > Erik > > > > > >> 4 apr 2016 kl. 01:00 skrev Erik Ronström <eri...@do...>: >> >> Answering myself: it is not possible in the current implementation. >> >> The call to getaddrinfo in lo_server_new_with_proto_internal is hardcoded to use NULL as node and AI_PASSIVE for hints.ai_flags, which means that getaddrinfo will return wildcard addresses. >> >> Guess I’ll have to patch lo_server_new_with_proto_internal… >> >> Erik >> >> >>> 3 apr 2016 kl. 10:20 skrev Erik Ronström <eri...@do...>: >>> >>> Hi, >>> >>> Is it possible to tell liblo to run a server only listening to >>> localhost? I want to avoid the Windows Firewall popping up a warning >>> when my audio server is started, and since I am only interested in >>> connections from the same machine, it seems like it can be solved by >>> binding the server to 127.0.0.1 >>> (http://stackoverflow.com/questions/3375435/avoid-windows-firewall-popup-with-sockets-on-localhost). >>> >>> Thanks >>> Erik >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Transform Data into Opportunity. >>> Accelerate data analysis in your applications with >>> Intel Data Analytics Acceleration Library. >>> Click to learn more. >>> http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140 >>> _______________________________________________ >>> liblo-devel mailing list >>> lib...@li... >>> https://lists.sourceforge.net/lists/listinfo/liblo-devel >> >> >> ------------------------------------------------------------------------------ >> Transform Data into Opportunity. >> Accelerate data analysis in your applications with >> Intel Data Analytics Acceleration Library. >> Click to learn more. >> http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140 >> _______________________________________________ >> liblo-devel mailing list >> lib...@li... >> https://lists.sourceforge.net/lists/listinfo/liblo-devel > > > ------------------------------------------------------------------------------ > > _______________________________________________ > liblo-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/liblo-devel > |