cleaned up demo scripts locations
[urisagit/Stem.git] / Design / sock_msg_notes
CommitLineData
4536f655 1Stem::Sock::Msg
2
3This cell is the primary way of interfacing external programs to the
4Stem messaging system. It is effectively a gateway with a standard
5socket on the outside and a message interface on the inside. The
6socket side takes standard Stem socket parameters for configuration.
7The message side has a variety of message types and options to
8control buffering.
9
10The socket parameters are directly passed to a Stem::Socket cell, and
11supports both client and server modes. Multiple instances of this
12Stem::Sock::Msg cell are supported and can be created via socket
13connection or acceptance. If a connected socket is externally shut
14down it can optionally be reconnected automatically.
15
16When the socket is connected or disconnected, a status message can be
17sent out. This is used to trigger the addressed cell to be made
18aware of the new socket status and act accordingly. For example, in
19an inetd emulation, the socket connected message would cause the
20address Stem::Proc cell to start a process and logically connect it
21to this Stem::Sock::Msg cell. Similarly, the socket closed message
22would cause the process to shut down and the logical connection to be
23broken.
24
25When data comes in from the socket, it is buffered and sent out via a
26data message to an addressed cell. Optionally, all incoming data can
27be buffered and only sent out in a single message when the socket is
28closed. This reduces the need for some cells to do their own
29buffering.
30
31As with all Stem cells, various status information can be logged to
32logical logs using the Stem logging system. Which status is logged
33can be controlled by the configuration of the cell.