next up previous contents
Next: 11. Recognised signals Up: Dwun 0.8g Previous: 9.4 Vim dialrc syntax   Contents


10. Custom/verbose client messages

You can send clients customised messages by sending data into a named pipe. (Or fd 3 with the onconnect/ondisconnect/pre_commandon/pre_commandoff commands).

Data sent to the FIFO starts with a %username or pid (as for admin commands8) followed by a colon and then the text message. The username can be an ordinary user or a meta-user8 like %con (which matches all CONNECTed users). With meta-users you still have to add a % to a front, even though they also start with a %. (i.e. use %%all, %%con, %%unknown).

The text data should start with '#' otherwise some clients will exit, thinking it's an error message. The message should also end in a newline. (Echo does this by default). Messages sent in ip-up after sending SIGUSR2 to dwun will not be seen; send them before you send that signal. It is safe to send a message after SIGUSR1 or SIGINT.

When using external, ``#Reconnecting'' and the message after a ``#Connect failed'' are supressed, to allow us to use more specific messages.

For example, to send ``#Hello my pretties'' to all CONNECTed users,

echo '%%con:#Hello my pretties' > /usr/lib/dwun-msg
Using fd 3 this would be

echo '%%con:#Hello my pretties' >&3
Make sure each line is below 512 characters in length.


next up previous contents
Next: 11. Recognised signals Up: Dwun 0.8g Previous: 9.4 Vim dialrc syntax   Contents

2000-06-15