
The ':monitor:' capability allows an NSM client to get informations from the NSM server about other clients in the session.

To become a monitor client, the client MUST check if the NSM server has the ':monitor:' capability, and its capability string MUST contain ':monitor:'.

Just before receiving the first /nsm/client/open message, the monitor client will receive for each client in the session the following status message:

/nsm/client/monitor/client_state s:client_id i:is_started

'is_started' is 1 if the client is started or 0 if the client is stopped.

A monitor client can query the state of the other clients at any time by sending this message to the server

/nsm/server/monitor_reset


At each event, this monitor client will receive :

/nsm/client/monitor/client_event s:client_id s:event

where 'event' can be

started
joined
ready
saved
stopped_by_server
stopped_by_itself
removed
open_error
save_error
start_request
save_request
stop_request

the 'joined' event happens when a client is started from the outside, for example when it is started from the shell with the command `NSM_URL=server_url executable`.

in RaySession, the 'removed' event happens when a client is definitely removed from the trash.

Note that a monitor client does not receives /nsm/client/monitor_event if the event
concerns this monitor client.


-------------------------------------

In RaySession, there is also the possibility for an external program to become a monitor.
This allows to get informations on the session clients and be warned of clients events without being a session client.
The program becomes a ray-daemon monitor with:

/ray/server/monitor_announce

it MUST send to server the following message before to be stopped:

/ray/server/monitor_quit


It will receives the same messages than a monitor client, but for logical reasons,
'/nsm/client/monitor/' is substitued with '/ray/monitor/' in paths.

it receives client states and events at 
/ray/monitor/client_state s:client_id i:is_started
/ray/monitor/client_event s:client_id s:event
