\begin{comment}
This is the state machine for the smpd close commands.
Graph [smpd close],
      [size="7.5, 10"]
\end{comment}
\begin{verbatim}
Action [close],[label="close"]
	Change_State([writing closed], [label="no children"])
	Change_State([writing close], [label="left"])
	Change_State([writing close], [label="right"])
State [writing close],[label="writing close"]
	Event [data written]
		Change_State([reading cmd header])
State [writing closed],[label="writing closed"]
	Event [data written]
		Change_State([closing])
State [closing],[label="closing"]
	Event [closed]
		if listener
			Change_State([closing],[label="close listener"])
		else
			Change_State([done])
State [done],[label="done"]

Action [closed],[label="closed"]
	Change_State([writing closed request],[label="left"])
	Change_State([writing closed request],[label="right"])
	Change_State([closing],[label="parent"])
State [writing closed request],[label="writing closed request"]
	Event [data written]
		Change_State([reading cmd header])
		
Action [closed request],[label="closed request"]
	Change_State([writing closed])

State [reading cmd header],[label="reading cmd header"]
\end{verbatim}

