RE: [netatalk-admins] how to send messages to netatalk clients


Subject: RE: [netatalk-admins] how to send messages to netatalk clients
From: Peter Gutowski (peterg@powervue.com)
Date: Thu Jul 15 1999 - 11:41:02 EDT


         Reply to: RE: [netatalk-admins] how to send messages to netatalk client
Claudia Müller wrote:
>is there any possibility to send messages to users, who work via
>netatalk on the linux machine? It would be helpfull to inform people
>befor I shut down the service.
>I know that with kill -HUP afpd users will be informed, that the
>services will shut down in 5 Minutes. But is there a way to send
>messages without killing afpd?
>
>Claudia Müller
>

Quite a while ago I wrote a mac INIT which I called "Msg". When it loads it registers itself on the local network as type "Messenger" with the name being the current machine name. It then waits until somebody sends it an appletalk message at which time it puts up a modal dialog box on the user's screen. The dialog box displayed the text of the message. I *do* have the source of this somewhere which I will gladly supply as well, but for the moment all I have is the INIT. (By my recollection, Msg will buffer up to 1500 chars for 6 messages. I didn't like the fact that the dialog box was modal which interrupted any ongoing activities, i.e. printing a large file would cause the printer connection to timeout unless you were right there to say "OK" to the dialog box. But once you have the source for that, you can change that behaviour too!)

Later when I started using linux and netatalk I wrote a sample program would allow somebody to send a message to any machine that has the "Msg" INIT running. Example session:

(root on lx3) atalktest # ptest1

Usage: ptest1 <recipient> "message to send"

(root on lx3) atalktest # ptest1 "ECRM" "Just saying hi"
ECRM Messenger *
nn_sat.sat_addr.s_node = 130
nn_sat.sat_addr.s_net = 65281
nn_sat.sat_port = 251
Normal completeion! Message=
(root on lx3) atalktest #

At this point the Mac called "ECRM" would have a modal dialog box up and display the sample message above ("Just saying hi!") until somebody presses the OK button.

The files can be found at ftp.powervue.com in the /pub/messenger directory:

-rw-r--r-- 1 peterg users 354 Jul 15 11:11 Makefile
-rw-r--r-- 1 peterg users 8981 Jul 15 11:10 Msg.hqx { contains Msg: put into Extensions folder }
-rwxr-xr-x 1 peterg users 15430 Jul 15 11:11 ptest1
-rw-r--r-- 1 peterg users 2224 Jul 15 11:11 ptest1.c
-rw-r--r-- 1 peterg users 2736 Jul 15 11:11 ptest1.o

You probably need to adjust the Makefile to point correctly to where your libatalk.a is located. Keep in mind that this is just a sample program and will give you a start toward making something more functional.

Peter Gutowski

Power-Vue Graphics



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:16:57 EST