On 24-Jun-99 Matt Koss wrote: > On ©t, 24 jún 1999, Bjoern.Kahl wrote: > >Hallo ! > > Hi, > > as you might know, I have started some work on ConnectionWatcher > myself and I would like to know some things about your program. Hallo ! I haven´t recognized, you have started, but if I remember correctly, you are that person, who asked first about a way to find out if we are connected. > How does the user specify the type of the connection ? > How does your program starts / stops connection ? > Is it possible to set that the program will use e.g. kppp or kisdn > for connecting ? I am not sure, we are speaking about the same things ? What I wrote is a backgroundservice, without a native gui where a user can set some thing. (Not really true. I am writing on a gui now.) Of course, I do not re-invent everything. I use the normal commands like SuSE's ppp-on to start or stop a connection (better explaint on the web. My english is not good, most text on was heavily spell- and grammar-fixed by my girlfriend). What to use to start/stop connection is freely configurable, as long as it could be used on commandline. If there is a way to run kppp from commandline, it could be used. But I don't know why we should use it. (Never understood why kppp, xppp, kisdn and friends make sense: I configure how to connect or disconnect when I install the system, and after that point, i just type in "goonline" or click on a button, which in turn start isdnctrl or pppd. (Normal user should not play with systemconfiguration, and networksetup is part of systemconfiguration, IMHO. Especially on multiuser machines).) > My idea was to create a general Connection Watcher with a CORBA > interface. > Apps like kmail, konqueror, caitoo or icq clients would then only > connect to > the CORBA signal and they would get info when connected / > disconnected. > Interface definition would also contain methods for connecting and > disconnecting. This is what I have done. Its working. Example: I receive my mail and news using a single crontab-entry: "00 3 * * * /usr/local/NetMgr2/bin/runjob -r 10" "runjob" (part of NetMgr-system) register itself with my NetMgr, request the netmgr to run predefined job #10, and exist. NetMgr then: - try to establish a connection, - starts that job (in my case a shellscript running "fetchmail", "sendmail -q" and "suck") - disconnects after return of the job, - loggs used time (so, on a multiuser-machine, you could charge user for connectiontime) Of course, other clients can register themself at the any time, running other predefined jobs or simply request the server to establish a connection. The predefined job way is for thinks, user should be able to do, but would require root (like "sendmail -q"). NetMgr runs as root, so user can execute (via netmgr) network-related programms requiring root. Normal way is, a programme (like Caitoo) register itself with NetMgr, requests a connection if needed, waits for the connection, use it, withdraw onlinerequest, unregister, exits: ( Pseudocode: ) - - - - - - - - - - - - - - - - - - init() { .... NetMgr_register(applicationame,0); /* may be, if you want */ netmgrsocket = NetMgr_getsocket(); NetMgr_requestlink(NETMGR_CMD_NOTIFY, all_events_you_want_to_have); ... } mainloop { ... /* start connecting */ NetMgr_requestlink(NETMGR_CMD_GOONLINE); . . . . . . . . . . . . . . . . . . . . . . . . /* pooling, (bad but possible) */ for (;;) { NetMgr_requestlink(NETMGR_CMD_LINKSTAT, &rp); if (rp->rt.ls.status & NETMGR_LIF_ONLINEFAILED) .... /* failure exit */ if (rp->rt.ls.status & NETMGR_LIF_ONLINE) .... /* ok exit */ do_some_thing_else(); } . . . . . . . . . . . . . . . . . . . . . . . . /* waiting (better - requires you to request the needed events via "NETMGR_CMD_NOTIFY") */ ... select(n, readset, writeset, exclset, timeout); if (FD_ISSET(netmgrsocket, readset)) { NetMgr_processio(); NetMgr_querylink(NETMGR_CMD_NOTIFYCHECK, &rp); if (rp->rt.no.status & NETMGR_NOTIFY_ONLINE) ... /* ok exit */ if (rp->rt.no.status & NETMGR_NOTIFY_ONLINEFAILED) ... /* failexit */ } ... . . . . . . . . . . . . . . . . . . . . . . . . /* use link */ .... /* don´t need the connection any longer */ NetMgr_requestlink(NETMGR_CMD_GOOFFLINE); } -------------------------------------------------------------------- The NetMg will establish a link as soon as and as long as there is any programme registered *and* requesting to be online. Of course, the NetMgr may be restricted to certain times (via disable and enable-commands - buildin timerules are a good idea, will do that next weekend). There are commands to go permanently online (without a programm beeing registered) and offline again. Everything is multiuser-save. > I have started some work on it using the code from Caitoo, and also > created a kcm module for general configuration ( type of connection, > time interval ). This is really great. (I know, I wrote I don't understand sense of kpp, lisdn etc. but, if people use it, its ok.) I would be really happy, if I may use your kmc module for configuring NetMgr. It has only one Configfile (key - value pairs) which could easily created using your kmc. (See install-chaper on web or downloaded files.) > Dialog would also contain a preferred app for connecting ( this would > require some cooperation on kppp / kisdn side ). > I just hope that the functionality will be similar. I don't know, what you have done. But we really should try to merge things. Have a look at my web-page: The whole source and documentation is online browseable and downloadable available. May be, we should discuss details by private email (not over the list). Ciao Bjoern -- +-----------------------------------------------------------------------+ | Björn Kahl ++ Max-Planck-Str.26 ++ 24211 Preetz ++ (ISDN) 04342 76882 | +-----------------------------------------------------------------------+ Weitergabe und/oder gewerbliche Nutzung meiner Adresse/TeleNr untersagt.