On Mon, Mar 8, 2010 at 10:50 AM, R. Matthew Emerson <span dir="ltr"><<a href="mailto:rme@clozure.com">rme@clozure.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On Mar 7, 2010, at 2:36 PM, Elliott Slaughter wrote:<br>
<br>
> What I am actually trying to do is to search for other nodes on the local network which are also running my application. My idea was to construct one or more broadcast addresses, send UDP packets to each of them, and listen for responses. This may not be the best way to go about this (and suggestions would be appreciated), but if I choose this route, I would want to know the IP address of each of the interfaces together with its subnet mask.<br>

><br>
> On 2010-03-07, at 07:20 , Elliott Slaughter wrote:<br>
><br>
> if you really need this, you might look at the implementation for %get-ip-interfaces in clozure.<br>
> it uses getifaddrs in a fairly transparent manner, so, if you're unix-based, you should be ok with it.<br>
><br>
> I need this to work on Windows and *nix, which is why I can't use IOlib or other Unix-based solutions. That said, Clozure does run on Windows, so hopefully the code you mentioned has already been ported.<br>
<br>
</div>There's an internal function ccl::%get-ip-interfaces that's conditionalized for a bunch of platforms.  I can't really recommend that you use it, of course, but it might be something to look at.<br></blockquote>
<div><br></div><div>I glanced over the source briefly, and might give porting it to CFFI a shot when I can find some free time.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I wonder if you could use zeroconf/bonjour?  It sounds like your application might be a good fit. There's a reference to a CL interface at <a href="http://www.cliki.net/CL-ZEROCONF" target="_blank">http://www.cliki.net/CL-ZEROCONF</a> (though I don't know how complete/portable it is).<br>

</blockquote></div><br>I knew about Bonjour but didn't know about the CL interface for it. From looking around the source, it isn't obvious what it depends on (e.g. does it need Bonjour to be installed on the system?), although I did find a todo note saying it doesn't run on Windows yet.<br clear="all">
<br>-- <br>Elliott Slaughter<br><br>"Don't worry about what anybody else is going to do. The best way to predict the future is to invent it." - Alan Kay<br>