From: Ishan A. <ish...@us...> - 2006-12-20 06:21:11
|
Thanks. The sample is of great help On 12/20/06, William H. Schultz <whs...@ce...> wrote: > > I see. That makes more sense--that it would be source-code compatible, > similar to WINE. That would relieve the effort of implementation quite a > bit. > While it may be a while before I get around to writing serious > documentation, I can at least go ahead and put some effort into squeezing > this into the existing socket sample. That should help get you up and > running. > > ------------------------------- > Hank Schultz > Cedrus Corporation > http://www.cedrus.com / > > > On Dec 18, 2006, at 7:01 PM, Ishan Arora wrote: > > William, > What I insisted in last post was " Avahi also implements binary > compatibility libraries that emulate Bonjour and Howl". I guess I should have > used a different font :) > Since Avahi sounds more native and also emulates Bonjour in different > binaries, you wont have to modify your code (much). Moreover it comes > installed with most linux; we don't have much reason to give a Linux user > the trouble of installing Bonjour > > > On 12/19/06, William H. Schultz <whs...@ce... > wrote: > > > > It isn't visible straight from wxCode because I'm using wxCode's > > subversion repository instead of the CVS repository. This allowed me to > > point to it as an external source within our own internal project's svn > > repo. I also haven't packaged up a release, as I have no documentation or > > anything to help people build a project. > > About Avahi, if that's what is commonly shipping on Linux systems, then > > that would probably be the better route to take on those platforms. As > > currently implemented, wxDNSSD relies on Apple's implementation. I imagine > > Avahi wouldn't be particularly difficult to implement into my existing > > framework. I suspect the structure will likely be very similar (if not > > identical), but a lot of the code I've written probably won't apply. I have > > a suspicion it would wind up being a parallel implementation, like much of > > wxWidgets' cross-platform support. > > > > It may not be a bad idea to see if my implementation works with Apple's > > Bonjour on Linux. If it does, you could still do an Avahi implementation, > > but this would make it much easier to ensure that software written against > > wxDNSSD will work the same regardless of the backend. (just an idea) > > > > > > Anyway, I committed a change to servicediscoverytaskbase.h a few minutes > > ago, so there should be a little more information there on what you need to > > know to get going. It's getting late, so I'm headed home for the evening. > > > > > > We should probably continue this discussion on the wxCode mailing > > list. https://lists.sourceforge.net/lists/listinfo/wxcode-users I > > figured I would mention this before starting to CC the list (in case you > > have privacy concerns about anything you've already mentioned). > > > > > > ------------------------------- > > Hank Schultz > > Cedrus Corporation > > http://www.cedrus.com / > > > > > > On Dec 18, 2006, at 5:54 PM, Ishan Arora wrote: > > > > William, > > Why is this project not accessible straight from wxCode? It would be > > more visible to the interested that way. My purpose is to create an open > > source network messenger. I am thinking of using Bonjour for the messenger > > to know the presence of other instances of the messenger on the network. Is > > there a better way you wish to recommend? > > > > > > I just came across this on wikipedia.org > > > > Avahi <http://en.wikipedia.org/wiki/Avahi_%28software%29> is a Zeroconf > > implementation for Linux <http://en.wikipedia.org/wiki/Linux> and BSDs<http://en.wikipedia.org/wiki/Berkeley_Software_Distribution>. > > It implements IPv4LL, mDNS and DNS-SD. It is part of every major and many > > minor Linux distributions, and is installed by default on e.g. Ubuntu<http://en.wikipedia.org/wiki/Ubuntu_%28Linux_distribution%29>version > > 6.10. If run in conjunction with nss-mdns<http://0pointer.de/lennart/projects/nss-mdns/>it also offers host name resolution. > > > > Avahi also implements binary compatibility libraries that emulate > > Bonjour and Howl, so software made to use those implementations can also > > utilize Avahi through the emulation interfaces. > > > > > > On 12/19/06, William H. Schultz < whs...@ce...> wrote: > > > > > > Thanks! It was also just the thing I needed. Of course, since no one > > > had published a good implementation, I did the best I could and put it out > > > there for everyone else. The key things missing are documentation and > > > support for text records. I'm working right now on adding a short blurb to > > > the servicediscoverytaskbase.h header file to give a quick overview of > > > how stuff works. I hope to have this committed within the next half hour. > > > > > > Hank Schultz > > > > > > <cedrus_logo_w140.gif> > > > > > > http://www.cedrus.com/ > > > > > > > > > On Dec 18, 2006, at 5:34 PM, Ishan Arora wrote: > > > > > > William, > > > I guess I am the first one to be interested because the project is > > > relatively new and alpha version :) > > > Anyways I am finding Bonjour just the right thing for my project, so I > > > owe you a big "Thank You!!!" for helping me use it in wxWidgets. I'll try to > > > contribute to your side project ;) > > > Thank you > > > > > > > > > On 12/19/06, William H. Schultz < whs...@ce...> wrote: > > > > > > > > It has not been tested. There is a mechanism implemented to work > > > > based on the select() type of receiving events, which should theoretically > > > > be compatible with Linux. I tried to use this but had issues. I don't > > > > recall if I tried it on both OS X and Windows, but I think I may have. This > > > > would rely on idle events. I also tried a threaded implementation, allowing > > > > the bonjour calls to block. I don't recall precisely why I'm not using this > > > > method myself. > > > > There are two methods implemented that could potentially work on > > > > Linux. Unfortunately, I know I had some kind of issues with both of these > > > > methods on either Windows or Mac OS X, so you may have your work cut out for > > > > you to get it running on Linux. There is the slim possibility that it will > > > > work pretty easily for you--that is, the methods are implemented--but I > > > > wouldn't count on it. > > > > > > > > In the end, I had a hard time getting everything to work right on > > > > Windows, so it could just be that I didn't devote enough effort into > > > > tweaking things for the more globally available methods. > > > > > > > > Everything you need to make this work should be in > > > > servicediscoverytaskbase.h and .cpp. This is where the bonjour > > > > tasks get set up. Since they all work mostly the same way, all of the code > > > > is in here. One other place that may need modification is > > > > wxServiceDiscoveryResult::SetNetworkInterface(), which takes an integer > > > > index for the network interface and retrieves the name. On Mac OS X, this > > > > is en0, en1, fw0, etc... If the Mac OS X code for this doesn't work under > > > > Linux, it's just a matter of finding the line or two of code that takes this > > > > index and turns it into a name. > > > > > > > > If you're willing to look over Apple's DNS SD documentation, then > > > > the functionality of the code should be relatively clear. > > > > > > > > I have a vague recollection that the threaded implementation was a > > > > lot more reliable than the idle-event-initiated-select() implementation > > > > (though I think I had some issues with starting and stopping tasks). You > > > > are probably better off starting down this route. > > > > > > > > > > > > I'm planning on rewriting the socket sample to use this, but it may > > > > be a bit before I get around to it. > > > > > > > > > > > > Oh, and in case you didn't already know, Bonjour doesn't do much of > > > > anything for actual network communication. You're on your own to set up a > > > > server and or client. Bonjour just tells you what claims to be available > > > > (dns name and port... you have to get the IP yourself, but that should be > > > > implemented in my code in wxServiceDiscoveryResult::SetTarget). > > > > > > > > There are a lot of calls to wxLogDebug() to keep you informed as to > > > > what is going on. > > > > > > > > You're the first person to contact me to say, "hey, I'm > > > > interested!" Sorry about the disarray. Our potential use for this is way > > > > out in the future, so it's a low priority side project, relative to tech > > > > support and fixing bugs in shipping products. ;) > > > > > > > > Hank Schultz > > > > > > > > <cedrus_logo_w140.gif> > > > > > > > > http://www.cedrus.com/ > > > > > > > > > > > > On Dec 18, 2006, at 4:50 PM, Ishan Arora wrote: > > > > > > > > William, > > > > Thank you for your response. I am really thankful. Does wxDNSSD also > > > > work on linux, even if not tested? > > > > > > > > On 12/19/06, William H. Schultz < whs...@ce...> wrote: > > > > > > > > > > Ishan, > > > > > Yes, I have. So far, it seems to be working pretty well for me > > > > > internally. I haven't yet inflicted it on anyone else in my company, and > > > > > especially not any users yet. You can get the source code here: > > > > > > > > > > https://svn.sourceforge.net/svnroot/wxcode/trunk/wxCode/components/servicediscovery/ > > > > > (works in a web browser or subversion client) > > > > > > > > > > I don't have anything to help build it yet. I'm currently > > > > > including the source files as if they were part of my own project. In > > > > > include/wx/servicediscoverydef.h, this code is configured to only build in > > > > > debug mode, so you will likely want to modify this file. > > > > > > > > > > There is one Bonjour feature that is missing, and that's the text > > > > > records. At the moment, I have no use for it, so I haven't implemented it. > > > > > Everything else is working fine for me on Windows and Mac OS X. > > > > > > > > > > I'm sorry that I haven't yet put together a sample to show off how > > > > > to use this functionality, but it's relatively simple. There are four > > > > > primary data types: browser, resolver, service, and result. If you have > > > > > something to announce, you create a service and then start it. If you want > > > > > to find something, you create a service but *don't* start it. You provide > > > > > this service to the browser. The browser returns results via events. These > > > > > results don't have full IP information, so you need to resolve your > > > > > results. The same result objects are used for both, and an object array has > > > > > been defined in servicediscoveryresult.h to make it easier to keep > > > > > up with the results. > > > > > > > > > > An important detail to remember is that all bonjour tasks must be > > > > > started and stopped for anything to happen (browser, resolver, and service > > > > > are all tasks). If you don't start your service, it won't be visible (this > > > > > is what you want if you are looking for results but not if you have a > > > > > service to offer). If you don't start the browser, you will never get any > > > > > results. The browser should stay active until you no longer need results. > > > > > The resolver can probably be deactivated after you get your IP information. > > > > > > > > > > While bonjour supports IPv6, wxWidgets doesn't, so everything is > > > > > done with IPv4. > > > > > > > > > > > > > > > I hope this is enough to get you started! > > > > > > > > > > > > > > > Hank Schultz > > > > > > > > > > <cedrus_logo_w140.gif> > > > > > > > > > > http://www.cedrus.com/ > > > > > > > > > > > > > > > On Dec 18, 2006, at 3:37 PM, Ishan Arora wrote: > > > > > > > > > > hi > > > > > you seem to have created a wrapper class for Apple's Bonjour. it > > > > > seems to be very helpful from the description, but i am unable to access it. > > > > > can you please check it. if it takes time to put them for download then > > > > > please email me the files. > > > > > thank you > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |