Skip to content

Commit

Permalink
libceph: add some fine ASCII art
Browse files Browse the repository at this point in the history
Sage liked the state diagram I put in my commit description so
I'm putting it in with the code.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
  • Loading branch information
Alex Elder authored and Sage Weil committed Jul 6, 2012
1 parent 5821bd8 commit bc18f4b
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,47 @@
* the sender.
*/

/* State values for ceph_connection->sock_state; NEW is assumed to be 0 */
/*
* We track the state of the socket on a given connection using
* values defined below. The transition to a new socket state is
* handled by a function which verifies we aren't coming from an
* unexpected state.
*
* --------
* | NEW* | transient initial state
* --------
* | con_sock_state_init()
* v
* ----------
* | CLOSED | initialized, but no socket (and no
* ---------- TCP connection)
* ^ \
* | \ con_sock_state_connecting()
* | ----------------------
* | \
* + con_sock_state_closed() \
* |\ \
* | \ \
* | ----------- \
* | | CLOSING | socket event; \
* | ----------- await close \
* | ^ |
* | | |
* | + con_sock_state_closing() |
* | / \ |
* | / --------------- |
* | / \ v
* | / --------------
* | / -----------------| CONNECTING | socket created, TCP
* | | / -------------- connect initiated
* | | | con_sock_state_connected()
* | | v
* -------------
* | CONNECTED | TCP connection established
* -------------
*
* State values for ceph_connection->sock_state; NEW is assumed to be 0.
*/

#define CON_SOCK_STATE_NEW 0 /* -> CLOSED */
#define CON_SOCK_STATE_CLOSED 1 /* -> CONNECTING */
Expand Down

0 comments on commit bc18f4b

Please sign in to comment.