Rendezvous in php

php.internals

Unnamed Person

22 years ago
I apologize if this is the wrong place for this. I have been working on building a rendezvous php module, and have a proof of concept. I've been developing it on windows, but I think it should compile fine for the real platforms. Feel free to point and laugh, it isn't amazing code. sample usage: <? $conn = rendezvous_register_service( "_http._tcp" //dnstype , 4500 //port 0// optional - interface. 0 means all, -1 means local only. );//returns a rendezvous connection resource $servers = rendezvous_browse( "_http._tcp" //dnstype , 2 //optional - timeout in seconds , 100 //optional - timeout in microseconds , 0 //optional - interface, see above... );//returns an array of hosts that responded. echo("<pre>"); print_r($conn); print_r($servers); echo("</pre>"); rendezvous_unregister_service($conn);//stop advertising ?> John LeSueur

Christian Stocker

22 years ago
Hi first. pecl-dev@lists.php.net is the right place for this second. there's already a zeroconf extension at pecl (based on howl), which does some rendezvous stuff. Maybe you could join efforts with them. http://pecl.php.net/package-info.php?package=zeroconf But yes, rendezvous support in PHP could certainly have its uses. chregu On 6.7.2004 23:41 Uhr, John LeSueur wrote:
> I apologize if this is the wrong place for this. I have been working on > building a rendezvous php module, and have a proof of concept. I've been > developing it on windows, but I think it should compile fine for the > real platforms. Feel free to point and laugh, it isn't amazing code. > sample usage: > > <? > $conn = rendezvous_register_service( > "_http._tcp" //dnstype > , 4500 //port > 0// optional - interface. 0 means all, -1 means > local only. > );//returns a rendezvous connection resource > $servers = rendezvous_browse( > "_http._tcp" //dnstype > , 2 //optional - timeout in seconds > , 100 //optional - timeout in microseconds > , 0 //optional - interface, see above... > );//returns an array of hosts that responded. > echo("<pre>"); > print_r($conn); > print_r($servers); > echo("</pre>"); > rendezvous_unregister_service($conn);//stop advertising > ?> > > John LeSueur >
-- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid 0x5CE1DECB

Sara Golemon

22 years ago
> I apologize if this is the wrong place for this. I have been working on > building a rendezvous php module, and have a proof of concept. I've been > developing it on windows, but I think it should compile fine for the > real platforms. Feel free to point and laugh, it isn't amazing code. > sample usage: >
Looks pretty clean.. I've never worked with Rondevouz, I understand it's something like a link-local multicast version of portmap? I see that it requires linking against an external library, how is that library licensed? Are there unix versions of that library available as well? (the zip only contains a windows .lib file) More imporatantly, do you have a link to the site you got that library from? (Save the rest of us some googling) It sounds like something that would fit nicely into PECL. Be sure to bring it up within that forum. Interfaces are numbered from 1 then? Would it make sense to use a "Network Device Friendly Name" under windows? (performing the lookup silently using Win32API calls) That might not be a wonderful idea as there's not much in the way of POSIX standardization when it comes to mapping unix interface names to interface numbers... -Sara

Unnamed Person

22 years ago
Sara Golemon wrote:
>>I apologize if this is the wrong place for this. I have been working on >>building a rendezvous php module, and have a proof of concept. I've been >>developing it on windows, but I think it should compile fine for the >>real platforms. Feel free to point and laugh, it isn't amazing code. >>sample usage: >> >> >> >Looks pretty clean.. > >I've never worked with Rondevouz, I understand it's something like a >link-local multicast version of portmap? > > >
It uses multicast dns queries and replies to advertise services. it does only work link-local, although they intend to add a unicat dns query that will be able to browse services across routing.
>I see that it requires linking against an external library, how is that >library licensed? Are there unix versions of that library available as >well? (the zip only contains a windows .lib file) > > >
It's based off Apple's rendezvous implementation. http://developer.apple.com/macosx/Rendezvous/ The license is APSL(Not entirely open, but free). I'm not sure what the ramifications of the licensing will be. I kind of just threw this together, hoping it would work.
>More imporatantly, do you have a link to the site you got that library from? >(Save the rest of us some googling) > >It sounds like something that would fit nicely into PECL. Be sure to bring >it up within that forum. > > >
I think I'm going to move this discussion to Pecl
>Interfaces are numbered from 1 then? Would it make sense to use a "Network >Device Friendly Name" under windows? (performing the lookup silently using >Win32API calls) That might not be a wonderful idea as there's not much in >the way of POSIX standardization when it comes to mapping unix interface >names to interface numbers... > >-Sara > > >
To be honest, I'm not sure about the interfaces thing. Right now, that's just getting passed directly to the underlying library. John LeSueur