Diff for "XSessionManagementProtocol"

Differences between revisions 5 and 6
Revision 5 as of 2008-01-09 07:08:14
Size: 50992
Editor: pool-71-106-50-143
Comment:
Revision 6 as of 2008-05-16 05:53:52
Size: 51426
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
[[TableOfContents(2)]] <<TableOfContents(2)>>
Line 50: Line 50:
|| [#type_BOOL BOOL] || False or True ||
|| [#type_INTERACT_STYLE INTERACT_STYLE] || None, Errors, or Any ||
|| [#type_DIALOG_TYPE DIALOG_TYPE] || Error or Normal ||
|| [#type_SAVE_TYPE SAVE_TYPE] || Global, Local, or Both ||
|| [[#type_BOOL|BOOL]] || False or True ||
|| [[#type_INTERACT_STYLE|INTERACT_STYLE]] || None, Errors, or Any ||
|| [[#type_DIALOG_TYPE|DIALOG_TYPE]] || Error or Normal ||
|| [[#type_SAVE_TYPE|SAVE_TYPE]] || Global, Local, or Both ||
Line 57: Line 57:
|| [#type_ARRAY8 ARRAY8] || a sequence of CARD8s ||
|| [#type_LISTofARRAY8 LISTofARRAY8] || a sequence of [#type_ARRAY8 ARRAY8] ||
|| [#type_PROPERTY PROPERTY] || a property name (an [#type_ARRAY8 ARRAY8]), a type name, and a value of that type ||
|| [#type_LISTofPROPERTY LISTofPROPERTY] || a counted collection of [#type_PROPERTY PROPERTY]s ||
|| [[#type_ARRAY8|ARRAY8]] || a sequence of CARD8s ||
|| [[#type_LISTofARRAY8|LISTofARRAY8]] || a sequence of [[#type_ARRAY8|ARRAY8]] ||
|| [[#type_PROPERTY|PROPERTY]] || a property name (an [[#type_ARRAY8|ARRAY8]]), a type name, and a value of that type ||
|| [[#type_LISTofPROPERTY|LISTofPROPERTY]] || a counted collection of [[#type_PROPERTY|PROPERTY]]s ||
Line 65: Line 65:
Once assigned, all XSMP messages issued by this party will use the same major opcode. The message'sminor opcode specifies which protocol message this message contains. 6. Client Identification String A client ID is a string of XPCS characters encoded in ISO Latin 1 (ISO 8859-1). No null characters areallowed in this string. The client ID string is used in the [#protocol_RegisterClient RegisterClient] and [#protocol_RegisterClientReply RegisterClientReply] messages. Client IDs consist of the pieces described below. T he ID is formed by concatenating the pieces insequence, without separator characters. All pieces are padded on the left with '0' characters so as to fill the specified length. Decimal numbers are encoded using the characters `0' through `9', and hexadecimal num-bers using the characters `0' through `9' and `A' t hrough `F'. Once assigned, all XSMP messages issued by this party will use the same major opcode. The message'sminor opcode specifies which protocol message this message contains. 6. Client Identification String A client ID is a string of XPCS characters encoded in ISO Latin 1 (ISO 8859-1). No null characters areallowed in this string. The client ID string is used in the [[#protocol_RegisterClient|RegisterClient]] and [[#protocol_RegisterClientReply|RegisterClientReply]] messages. Client IDs consist of the pieces described below. T he ID is formed by concatenating the pieces insequence, without separator characters. All pieces are padded on the left with '0' characters so as to fill the specified length. Decimal numbers are encoded using the characters `0' through `9', and hexadecimal num-bers using the characters `0' through `9' and `A' t hrough `F'.
Line 94: Line 94:
[[Anchor(protocol_RegisterClient)]] <<Anchor(protocol_RegisterClient)>>
Line 97: Line 97:
 previous-ID:: [#type_ARRAY8 ARRAY8]
 Valid Responses:: [#protocol_RegisterClientReply RegisterClientReply]
 previous-ID:: [[#type_ARRAY8|ARRAY8]]
 Valid Responses:: [[#protocol_RegisterClientReply|RegisterClientReply]]
Line 100: Line 100:
 [#message_RegisterClient Message Format]

The client must send this message to the SM to register the client's existence. If a client is being restarted from a previous session, the previous-ID field must contain the client ID from the previous session. For new clients, previous-ID should be of zero length. If previous-ID is not valid, the SM will send a BadValue error message to the client. At this point the SM reverts to the register state and waits for another [#protocol_RegisterClient RegisterClient]. The client should then send a [#protocol_RegisterClient RegisterClient] with a null previous-ID field.

[[Anchor(protocol_RegisterClientReply)]]
 [[#message_RegisterClient|Message Format]]

The client must send this message to the SM to register the client's existence. If a client is being restarted from a previous session, the previous-ID field must contain the client ID from the previous session. For new clients, previous-ID should be of zero length. If previous-ID is not valid, the SM will send a BadValue error message to the client. At this point the SM reverts to the register state and waits for another [[#protocol_RegisterClient|RegisterClient]]. The client should then send a [[#protocol_RegisterClient|RegisterClient]] with a null previous-ID field.

<<Anchor(protocol_RegisterClientReply)>>
Line 107: Line 107:
 client-ID:: [#type_ARRAY8 ARRAY8]
 [#message_RegisterClientReply Message Format]

The client-ID specifies a unique identification for this client. If the client had specified an ID in the previous-ID field of the [#protocol_RegisterClient RegisterClient] message, client-ID will be identical to the previously specified ID. If previous-ID was null, client-ID will be a unique ID freshly generated by the SM. The client-ID format is specified in section 6.

If the client didn't supply a previous-ID field to the [#protocol_RegisterClient RegisterClient] message, the SM must send a SaveYourself message with type = Local, shutdown = False, interact-style = None, and fast = False immediately after the [#protocol_RegisterClientReply RegisterClientReply]. The client should respond to this like any other SaveYourself message.

[[Anchor(protocol_SaveYourself)]]
 client-ID:: [[#type_ARRAY8|ARRAY8]]
 [[#message_RegisterClientReply|Message Format]]

The client-ID specifies a unique identification for this client. If the client had specified an ID in the previous-ID field of the [[#protocol_RegisterClient|RegisterClient]] message, client-ID will be identical to the previously specified ID. If previous-ID was null, client-ID will be a unique ID freshly generated by the SM. The client-ID format is specified in section 6.

If the client didn't supply a previous-ID field to the [[#protocol_RegisterClient|RegisterClient]] message, the SM must send a SaveYourself message with type = Local, shutdown = False, interact-style = None, and fast = False immediately after the [[#protocol_RegisterClientReply|RegisterClientReply]]. The client should respond to this like any other SaveYourself message.

<<Anchor(protocol_SaveYourself)>>
Line 117: Line 117:
 type:: [#type_SAVE_TYPE SAVE_TYPE]
 shutdown:: [#type_BOOL BOOL]
 interact-style:: [#type_INTERACT_STYLE INTERACT_STYLE]
 fast:: [#type_BOOL BOOL]
 type:: [[#type_SAVE_TYPE|SAVE_TYPE]]
 shutdown:: [[#type_BOOL|BOOL]]
 interact-style:: [[#type_INTERACT_STYLE|INTERACT_STYLE]]
 fast:: [[#type_BOOL|BOOL]]
Line 122: Line 122:
 [#message_SaveYourself Message Format]  [[#message_SaveYourself|Message Format]]
Line 156: Line 156:
[[Anchor(protocol_SaveYourselfPhase2)]] <<Anchor(protocol_SaveYourselfPhase2)>>
Line 160: Line 160:
 [#message_SaveYourselfPhase2 Message Format]  [[#message_SaveYourselfPhase2|Message Format]]
Line 169: Line 169:
[[Anchor(protocol_SaveYourselfRequest)]] <<Anchor(protocol_SaveYourselfRequest)>>
Line 172: Line 172:
 type:: [#type_SAVE_TYPE SAVE_TYPE]
 shutdown:: [#type_BOOL BOOL]
 interact-style:: [#type_INTERACT_STYLE INTERACT_STYLE]
 fast:: [#type_BOOL BOOL]
 global:: [#type_BOOL BOOL]
 type:: [[#type_SAVE_TYPE|SAVE_TYPE]]
 shutdown:: [[#type_BOOL|BOOL]]
 interact-style:: [[#type_INTERACT_STYLE|INTERACT_STYLE]]
 fast:: [[#type_BOOL|BOOL]]
 global:: [[#type_BOOL|BOOL]]
Line 178: Line 178:
 [#message_SaveYourselfRequest Message Format]  [[#message_SaveYourselfRequest|Message Format]]
Line 187: Line 187:
[[Anchor(protocol_InteractRequest)]] <<Anchor(protocol_InteractRequest)>>
Line 190: Line 190:
 dialog-type:: [#type_DIALOG_TYPE DIALOG_TYPE]  dialog-type:: [[#type_DIALOG_TYPE|DIALOG_TYPE]]
Line 193: Line 193:
 [#message_InteractRequest Message Format]  [[#message_InteractRequest|Message Format]]
Line 197: Line 197:
[[Anchor(protocol_Interact)]] <<Anchor(protocol_Interact)>>
Line 201: Line 201:
 [#message_Interact Message Format]  [[#message_Interact|Message Format]]
Line 208: Line 208:
[[Anchor(protocol_InteractDone)]] <<Anchor(protocol_InteractDone)>>
Line 211: Line 211:
 cancel-shutdown:: [#type_BOOL BOOL]  cancel-shutdown:: [[#type_BOOL|BOOL]]
Line 213: Line 213:
 [#message_InteractDone Message Format]  [[#message_InteractDone|Message Format]]
Line 219: Line 219:
[[Anchor(protocol_SaveYourselfDone)]] <<Anchor(protocol_SaveYourselfDone)>>
Line 222: Line 222:
 success:: [#type_BOOL BOOL]  success:: [[#type_BOOL|BOOL]]
Line 224: Line 224:
 [#message_SaveYourselfDone Message Format]  [[#message_SaveYourselfDone|Message Format]]
Line 231: Line 231:
[[Anchor(protocol_SaveYourselfPhase2Request)]] <<Anchor(protocol_SaveYourselfPhase2Request)>>
Line 235: Line 235:
 [#message_SaveYourselfPhase2Request Message Format]  [[#message_SaveYourselfPhase2Request|Message Format]]
Line 239: Line 239:
[[Anchor(protocol_Die)]] <<Anchor(protocol_Die)>>
Line 243: Line 243:
 [#message_Die Message Format]  [[#message_Die|Message Format]]
Line 247: Line 247:
[[Anchor(protocol_SaveComplete)]] <<Anchor(protocol_SaveComplete)>>
Line 251: Line 251:
 [#message_SaveComplete Message Format]  [[#message_SaveComplete|Message Format]]
Line 255: Line 255:
[[Anchor(protocol_ShutdownCancelled)]] <<Anchor(protocol_ShutdownCancelled)>>
Line 258: Line 258:
 [#message_ShutdownCancelled Message Format]  [[#message_ShutdownCancelled|Message Format]]
Line 262: Line 262:
[[Anchor(protocol_ConnectionClosed)]] <<Anchor(protocol_ConnectionClosed)>>
Line 265: Line 265:
 reason:: [#type_LISTofARRAY8 LISTofARRAY8]
 [#message_ConnectionClosed Message Format]
 reason:: [[#type_LISTofARRAY8|LISTofARRAY8]]
 [[#message_ConnectionClosed|Message Format]]
Line 270: Line 270:
The reason field specifies why the client is resigning from the session. It is encoded as an array of Compound Text strings. If the resignation is expected by the user, there will typically be zero [#type_ARRAY8 ARRAY8]s here. But if the client encountered an unexpected fatal error, the error message (which might otherwise be printed on stderr on a POSIX system) should be forwarded to the SM here, one [#type_ARRAY8 ARRAY8] per line of the message. It is the responsibility of the SM to display this reason to the user. The reason field specifies why the client is resigning from the session. It is encoded as an array of Compound Text strings. If the resignation is expected by the user, there will typically be zero [[#type_ARRAY8|ARRAY8]]s here. But if the client encountered an unexpected fatal error, the error message (which might otherwise be printed on stderr on a POSIX system) should be forwarded to the SM here, one [[#type_ARRAY8|ARRAY8]] per line of the message. It is the responsibility of the SM to display this reason to the user.
Line 280: Line 280:
[[Anchor(protocol_SetProperties)]] <<Anchor(protocol_SetProperties)>>
Line 283: Line 283:
 properties:: [#type_LISTofPROPERTY LISTofPROPERTY]
 [#message_SetProperties Message Format]
 properties:: [[#type_LISTofPROPERTY|LISTofPROPERTY]]
 [[#message_SetProperties|Message Format]]
Line 290: Line 290:
[[Anchor(protocol_DeleteProperties)]] <<Anchor(protocol_DeleteProperties)>>
Line 293: Line 293:
 property-names:: [#type_LISTofARRAY8 LISTofARRAY8]
 [#message_DeleteProperties Message Format]
 property-names:: [[#type_LISTofARRAY8|LISTofARRAY8]]
 [[#message_DeleteProperties|Message Format]]
Line 298: Line 298:
[[Anchor(protocol_GetProperties)]] <<Anchor(protocol_GetProperties)>>
Line 302: Line 302:
 [#message_GetProperties Message Format]  [[#message_GetProperties|Message Format]]
Line 306: Line 306:
[[Anchor(protocol_GetPropertiesReply)]] <<Anchor(protocol_GetPropertiesReply)>>
Line 309: Line 309:
 values:: [#type_LISTofPROPERTY LISTofPROPERTY]
 [#message_GetPropertiesReply Message Format]
 values:: [[#type_LISTofPROPERTY|LISTofPROPERTY]]
 [[#message_GetPropertiesReply|Message Format]]
Line 324: Line 324:
[[Anchor(cstate_start)]] <<Anchor(cstate_start)>>
Line 326: Line 326:
 ICE protocol setup complete {{{->}}} [#cstate_register register]

[[Anchor(cstate_register)]]
 ICE protocol setup complete {{{->}}} [[#cstate_register|register]]

<<Anchor(cstate_register)>>
Line 330: Line 330:
 send [#protocol_RegisterClient RegisterClient] {{{->}}} [#cstate_collect-id collect-id]

[[Anchor(cstate_collect-id)]]
 send [[#protocol_RegisterClient|RegisterClient]] {{{->}}} [[#cstate_collect-id|collect-id]]

<<Anchor(cstate_collect-id)>>
Line 334: Line 334:
 receive [#protocol_RegisterClientReply RegisterClientReply] {{{->}}} [#cstate_idle idle]

[[Anchor(cstate_shutdown-cancelled)]]
 receive [[#protocol_RegisterClientReply|RegisterClientReply]] {{{->}}} [[#cstate_idle|idle]]

<<Anchor(cstate_shutdown-cancelled)>>
Line 338: Line 338:
 send SaveYourselfDone {{{->}}} [#cstate_idle idle]

[[Anchor(cstate_idle)]]
 send SaveYourselfDone {{{->}}} [[#cstate_idle|idle]]

<<Anchor(cstate_idle)>>
Line 342: Line 342:
 receive Die {{{->}}} [#cstate_die die]
 receive SaveYourself {{{->}}} [#cstate_freeze-interaction freeze-interaction]
 send GetProperties {{{->}}} [#cstate_idle idle]
 receive GetPropertiesReply {{{->}}} [#cstate_idle idle]
 send SetProperties {{{->}}} [#cstate_idle idle]
 send DeleteProperties {{{->}}} [#cstate_idle idle]
 send ConnectionClosed {{{->}}} [#cstate_connection-closed connection-closed]
 send SaveYourselfRequest {{{->}}} [#cstate_idle idle]

[[
Anchor(cstate_die)]]
 receive Die {{{->}}} [[#cstate_die|die]]
 receive SaveYourself {{{->}}} [[#cstate_freeze-interaction|freeze-interaction]]
 send GetProperties {{{->}}} [[#cstate_idle|idle]]
 receive GetPropertiesReply {{{->}}} [[#cstate_idle|idle]]
 send SetProperties {{{->}}} [[#cstate_idle|idle]]
 send DeleteProperties {{{->}}} [[#cstate_idle|idle]]
 send ConnectionClosed {{{->}}} [[#cstate_connection-closed|connection-closed]]
 send SaveYourselfRequest {{{->}}} [[#cstate_idle|idle]]

<<
Anchor(cstate_die)>>
Line 353: Line 353:
 send ConnectionClosed {{{->}}} [#cstate_connection-closed connection-closed]

[[Anchor(cstate_freeze-interaction)]]
 send ConnectionClosed {{{->}}} [[#cstate_connection-closed|connection-closed]]

<<Anchor(cstate_freeze-interaction)>>
Line 357: Line 357:
 freeze interaction with user {{{->}}} [#cstate_save-yourself save-yourself]

[[Anchor(cstate_save-yourself)]]
 freeze interaction with user {{{->}}} [[#cstate_save-yourself|save-yourself]]

<<Anchor(cstate_save-yourself)>>
Line 361: Line 361:
 receive ShutdownCancelled {{{->}}} [#cstate_shutdown-cancelled shutdown-cancelled]
 send SetProperties {{{->}}} [#cstate_save-yourself save-yourself]
 send DeleteProperties {{{->}}} [#cstate_save-yourself save-yourself]
 send GetProperties {{{->}}} [#cstate_save-yourself save-yourself]
 receive GetPropertiesReply {{{->}}} [#cstate_save-yourself save-yourself]
 send InteractRequest {{{->}}} [#cstate_interact-request interact-request]
 send SaveYourselfPhase2Request {{{->}}} [#cstate_waiting-for-phase2 waiting-for-phase2]
 receive ShutdownCancelled {{{->}}} [[#cstate_shutdown-cancelled|shutdown-cancelled]]
 send SetProperties {{{->}}} [[#cstate_save-yourself|save-yourself]]
 send DeleteProperties {{{->}}} [[#cstate_save-yourself|save-yourself]]
 send GetProperties {{{->}}} [[#cstate_save-yourself|save-yourself]]
 receive GetPropertiesReply {{{->}}} [[#cstate_save-yourself|save-yourself]]
 send InteractRequest {{{->}}} [[#cstate_interact-request|interact-request]]
 send SaveYourselfPhase2Request {{{->}}} [[#cstate_waiting-for-phase2|waiting-for-phase2]]
Line 369: Line 369:
  send SaveYourselfDone {{{->}}} [#cstate_save-yourself-done save-yourself-done]   send SaveYourselfDone {{{->}}} [[#cstate_save-yourself-done|save-yourself-done]]
Line 371: Line 371:
  send SaveYourselfDone {{{->}}} [#cstate_idle idle]

[[Anchor(cstate_waiting-for-phase2)]]
  send SaveYourselfDone {{{->}}} [[#cstate_idle|idle]]

<<Anchor(cstate_waiting-for-phase2)>>
Line 375: Line 375:
 receive ShutdownCancelled {{{->}}} [#cstate_shutdown-cancelled shutdown-cancelled]
 receive SaveYourselfPhase2 {{{->}}} [#cstate_phase2 phase2]

[[Anchor(cstate_phase2)]]
 receive ShutdownCancelled {{{->}}} [[#cstate_shutdown-cancelled|shutdown-cancelled]]
 receive SaveYourselfPhase2 {{{->}}} [[#cstate_phase2|phase2]]

<<Anchor(cstate_phase2)>>
Line 381: Line 381:
 receive ShutdownCancelled {{{->}}} [#cstate_shutdown-cancelled shutdown-cancelled]
``
 send SetProperties {{{->}}} [#cstate_save-yourself save-yourself]
``
 send DeleteProperties {{{->}}} [#cstate_save-yourself save-yourself]
``
 send GetProperties {{{->}}} [#cstate_save-yourself save-yourself]
``
 receive GetPropertiesReply {{{->}}} [#cstate_save-yourself save-yourself]
``
 send InteractRequest {{{->}}} [#cstate_interact-request interact-request] (errors only)
 receive ShutdownCancelled {{{->}}} [[#cstate_shutdown-cancelled|shutdown-cancelled]]
``
 send SetProperties {{{->}}} [[#cstate_save-yourself|save-yourself]]
``
 send DeleteProperties {{{->}}} [[#cstate_save-yourself|save-yourself]]
``
 send GetProperties {{{->}}} [[#cstate_save-yourself|save-yourself]]
``
 receive GetPropertiesReply {{{->}}} [[#cstate_save-yourself|save-yourself]]
``
 send InteractRequest {{{->}}} [[#cstate_interact-request|interact-request]] (errors only)
Line 395: Line 395:
  send SaveYourselfDone {{{->}}} [#cstate_save-yourself-done save-yourself-done]   send SaveYourselfDone {{{->}}} [[#cstate_save-yourself-done|save-yourself-done]]
Line 399: Line 399:
  send SaveYourselfDone {{{->}}} [#cstate_idle idle]
``

[[Anchor(cstate_interact-request)]]
  send SaveYourselfDone {{{->}}} [[#cstate_idle|idle]]
``

<<Anchor(cstate_interact-request)>>
Line 404: Line 404:
 receive Interact {{{->}}} [#cstate_interact interact]
 receive ShutdownCancelled {{{->}}} [#cstate_shutdown-cancelled shutdown-cancelled]

[[Anchor(cstate_interact)]]
 receive Interact {{{->}}} [[#cstate_interact|interact]]
 receive ShutdownCancelled {{{->}}} [[#cstate_shutdown-cancelled|shutdown-cancelled]]

<<Anchor(cstate_interact)>>
Line 409: Line 409:
 send InteractDone {{{->}}} [#cstate_save-yourself save-yourself]
 receive ShutdownCancelled {{{->}}} [#cstate_shutdown-cancelled shutdown-cancelled]

[[Anchor(cstate_save-yourself-done)]]
 send InteractDone {{{->}}} [[#cstate_save-yourself|save-yourself]]
 receive ShutdownCancelled {{{->}}} [[#cstate_shutdown-cancelled|shutdown-cancelled]]

<<Anchor(cstate_save-yourself-done)>>
Line 414: Line 414:
 receive SaveComplete {{{->}}} [#cstate_idle idle]
 receive Die {{{->}}} [#cstate_die die]
 receive ShutdownCancelled {{{->}}} [#cstate_idle idle]

[[Anchor(cstate_connection-closed)]]
 receive SaveComplete {{{->}}} [[#cstate_idle|idle]]
 receive Die {{{->}}} [[#cstate_die|die]]
 receive ShutdownCancelled {{{->}}} [[#cstate_idle|idle]]

<<Anchor(cstate_connection-closed)>>
Line 424: Line 424:
[[Anchor(smstate_start)]] <<Anchor(smstate_start)>>
Line 426: Line 426:
 receive ProtocolSetup {{{->}}} [#smstate_protocol-setup protocol-setup]

[[Anchor(smstate_protocol-setup)]]
 receive ProtocolSetup {{{->}}} [[#smstate_protocol-setup|protocol-setup]]

<<Anchor(smstate_protocol-setup)>>
Line 430: Line 430:
 send ProtocolSetupReply {{{->}}} [#smstate_register register]

[[Anchor(smstate_register)]]
 send ProtocolSetupReply {{{->}}} [[#smstate_register|register]]

<<Anchor(smstate_register)>>
Line 434: Line 434:
 receive [#protocol_RegisterClient RegisterClient] {{{->}}} [#smstate_acknowledge-register acknowledge-register]

[[Anchor(smstate_acknowledge-register)]]
 receive [[#protocol_RegisterClient|RegisterClient]] {{{->}}} [[#smstate_acknowledge-register|acknowledge-register]]

<<Anchor(smstate_acknowledge-register)>>
Line 438: Line 438:
 send [#protocol_RegisterClientReply RegisterClientReply] {{{->}}} [#smstate_idle idle]

[[Anchor(smstate_idle)]]
 send [[#protocol_RegisterClientReply|RegisterClientReply]] {{{->}}} [[#smstate_idle|idle]]

<<Anchor(smstate_idle)>>
Line 442: Line 442:
 receive SetProperties {{{->}}} [#smstate_idle idle]
 receive DeleteProperties {{{->}}} [#smstate_idle idle]
 receive ConnectionClosed {{{->}}} [#smstate_start start]
 receive GetProperties {{{->}}} [#smstate_get-properties get-properties]
 receive SaveYourselfRequest {{{->}}} [#smstate_save-yourself save-yourself]
 send SaveYourself {{{->}}} [#smstate_saving-yourself saving-yourself]

[[
Anchor(smstate_save-yourself)]]
 receive SetProperties {{{->}}} [[#smstate_idle|idle]]
 receive DeleteProperties {{{->}}} [[#smstate_idle|idle]]
 receive ConnectionClosed {{{->}}} [[#smstate_start|start]]
 receive GetProperties {{{->}}} [[#smstate_get-properties|get-properties]]
 receive SaveYourselfRequest {{{->}}} [[#smstate_save-yourself|save-yourself]]
 send SaveYourself {{{->}}} [[#smstate_saving-yourself|saving-yourself]]

<<
Anchor(smstate_save-yourself)>>
Line 451: Line 451:
 send SaveYourself {{{->}}} [#smstate_saving-yourself saving-yourself]

[[Anchor(smstate_get-properties)]]
 send SaveYourself {{{->}}} [[#smstate_saving-yourself|saving-yourself]]

<<Anchor(smstate_get-properties)>>
Line 455: Line 455:
 send GetPropertiesReply {{{->}}} [#smstate_idle idle]

[[Anchor(smstate_saving-get-properties)]]
 send GetPropertiesReply {{{->}}} [[#smstate_idle|idle]]

<<Anchor(smstate_saving-get-properties)>>
Line 459: Line 459:
 send GetPropertiesReply {{{->}}} [#smstate_saving-yourself saving-yourself]

[[Anchor(smstate_saving-yourself)]]
 send GetPropertiesReply {{{->}}} [[#smstate_saving-yourself|saving-yourself]]

<<Anchor(smstate_saving-yourself)>>
Line 463: Line 463:
 receive InteractRequest {{{->}}} [#smstate_saving-yourself saving-yourself]
 send Interact {{{->}}} [#smstate_saving-yourself saving-yourself]
 send ShutdownCancelled {{{->}}} [#smstate_idle idle]
 receive InteractDone {{{->}}} [#smstate_saving-yourself saving-yourself]
 receive SetProperties {{{->}}} [#smstate_saving-yourself saving-yourself]
 receive DeleteProperties {{{->}}} [#smstate_saving-yourself saving-yourself]
 receive GetProperties {{{->}}} [#smstate_saving-get-properties saving-get-properties]
 receive SaveYourselfPhase2Request {{{->}}} [#smstate_start-phase2 start-phase2]
 receive SaveYourselfDone {{{->}}} [#smstate_save-yourself-done save-yourself-done]

[[
Anchor(smstate_start-phase2)]]
 receive InteractRequest {{{->}}} [[#smstate_saving-yourself|saving-yourself]]
 send Interact {{{->}}} [[#smstate_saving-yourself|saving-yourself]]
 send ShutdownCancelled {{{->}}} [[#smstate_idle|idle]]
 receive InteractDone {{{->}}} [[#smstate_saving-yourself|saving-yourself]]
 receive SetProperties {{{->}}} [[#smstate_saving-yourself|saving-yourself]]
 receive DeleteProperties {{{->}}} [[#smstate_saving-yourself|saving-yourself]]
 receive GetProperties {{{->}}} [[#smstate_saving-get-properties|saving-get-properties]]
 receive SaveYourselfPhase2Request {{{->}}} [[#smstate_start-phase2|start-phase2]]
 receive SaveYourselfDone {{{->}}} [[#smstate_save-yourself-done|save-yourself-done]]

<<
Anchor(smstate_start-phase2)>>
Line 476: Line 476:
  send SaveYourselfPhase2 {{{->}}} [#smstate_phase2 phase2]
 else {{{->}}} [#smstate_saving-yourself saving-yourself]

[[Anchor(smstate_phase2)]]
  send SaveYourselfPhase2 {{{->}}} [[#smstate_phase2|phase2]]
 else {{{->}}} [[#smstate_saving-yourself|saving-yourself]]

<<Anchor(smstate_phase2)>>
Line 481: Line 481:
 receive InteractRequest {{{->}}} [#smstate_saving-yourself saving-yourself]
 send Interact {{{->}}} [#smstate_saving-yourself saving-yourself]
 send ShutdownCancelled {{{->}}} [#smstate_idle idle]
 receive InteractDone {{{->}}} [#smstate_saving-yourself saving-yourself]
 receive SetProperties {{{->}}} [#smstate_saving-yourself saving-yourself]
 receive DeleteProperties {{{->}}} [#smstate_saving-yourself saving-yourself]
 receive GetProperties {{{->}}} [#smstate_saving-get-properties saving-get-properties]
 receive SaveYourselfDone {{{->}}} [#smstate_save-yourself-done save-yourself-done]

[[
Anchor(smstate_save-yourself-done)]]
 receive InteractRequest {{{->}}} [[#smstate_saving-yourself|saving-yourself]]
 send Interact {{{->}}} [[#smstate_saving-yourself|saving-yourself]]
 send ShutdownCancelled {{{->}}} [[#smstate_idle|idle]]
 receive InteractDone {{{->}}} [[#smstate_saving-yourself|saving-yourself]]
 receive SetProperties {{{->}}} [[#smstate_saving-yourself|saving-yourself]]
 receive DeleteProperties {{{->}}} [[#smstate_saving-yourself|saving-yourself]]
 receive GetProperties {{{->}}} [[#smstate_saving-get-properties|saving-get-properties]]
 receive SaveYourselfDone {{{->}}} [[#smstate_save-yourself-done|save-yourself-done]]

<<
Anchor(smstate_save-yourself-done)>>
Line 494: Line 494:
   send Die {{{->}}} [#smstate_die die]    send Die {{{->}}} [[#smstate_die|die]]
Line 496: Line 496:
   send SaveComplete {{{->}}} [#smstate_idle idle]    send SaveComplete {{{->}}} [[#smstate_idle|idle]]
Line 498: Line 498:
  {{{->}}} [#smstate_saving-yourself saving-yourself]

[[Anchor(smstate_die)]]
  {{{->}}} [[#smstate_saving-yourself|saving-yourself]]

<<Anchor(smstate_die)>>
Line 508: Line 508:
[[Anchor(type_BOOL)]] <<Anchor(type_BOOL)>>
Line 513: Line 513:
[[Anchor(type_INTERACT_STYLE)]] <<Anchor(type_INTERACT_STYLE)>>
Line 519: Line 519:
[[Anchor(type_DIALOG_TYPE)]] <<Anchor(type_DIALOG_TYPE)>>
Line 524: Line 524:
[[Anchor(type_SAVE_TYPE)]] <<Anchor(type_SAVE_TYPE)>>
Line 530: Line 530:
[[Anchor(type_ARRAY8)]] <<Anchor(type_ARRAY8)>>
Line 536: Line 536:
[[Anchor(type_LISTofARRAY8)]] <<Anchor(type_LISTofARRAY8)>>
Line 540: Line 540:
|| a || [#type_ARRAY8 ARRAY8] || first array ||
|| b || [#type_ARRAY8 ARRAY8] || second array ||
|| a || [[#type_ARRAY8|ARRAY8]] || first array ||
|| b || [[#type_ARRAY8|ARRAY8]] || second array ||
Line 545: Line 545:
|| q || [#type_ARRAY8 ARRAY8] || last array ||

[[Anchor(type_PROPERTY)]]
|| q || [[#type_ARRAY8|ARRAY8]] || last array ||

<<Anchor(type_PROPERTY)>>
Line 549: Line 549:
|| a || [#type_ARRAY8 ARRAY8] || name ||
|| b || [#type_ARRAY8 ARRAY8] || type (XPCS encoded in Latin-1, case sensitive) ||
|| c || [#type_LISTofARRAY8 LISTofARRAY8] || values ||

[[Anchor(type_LISTofPROPERTY)]]
|| a || [[#type_ARRAY8|ARRAY8]] || name ||
|| b || [[#type_ARRAY8|ARRAY8]] || type (XPCS encoded in Latin-1, case sensitive) ||
|| c || [[#type_LISTofARRAY8|LISTofARRAY8]] || values ||

<<Anchor(type_LISTofPROPERTY)>>
Line 557: Line 557:
|| a || [#type_PROPERTY PROPERTY] || first property ||
|| b || [#type_PROPERTY PROPERTY] || second property ||
|| a || [[#type_PROPERTY|PROPERTY]] || first property ||
|| b || [[#type_PROPERTY|PROPERTY]] || second property ||
Line 562: Line 562:
|| q || [#type_PROPERTY PROPERTY] || last property || || q || [[#type_PROPERTY|PROPERTY]] || last property ||
Line 571: Line 571:
[[Anchor(message_RegisterClient)]]
|||||| '''Register``Client''' ([#protocol_RegisterClient description]) ||
<<Anchor(message_RegisterClient)>>
|||||| '''Register``Client''' ([[#protocol_RegisterClient|description]]) ||
Line 578: Line 578:
|| a || [#type_ARRAY8 ARRAY8] || previous-ID ||

[[Anchor(message_RegisterClientReply)]]
|||||| '''Register``Client``Reply''' ([#protocol_RegisterClientReply description]) ||
|| a || [[#type_ARRAY8|ARRAY8]] || previous-ID ||

<<Anchor(message_RegisterClientReply)>>
|||||| '''Register``Client``Reply''' ([[#protocol_RegisterClientReply|description]]) ||
Line 587: Line 587:
|| a || [#type_ARRAY8 ARRAY8] || client-ID ||

[[Anchor(message_SaveYourself)]]
|||||| '''Save``Yourself''' ([#protocol_SaveYourself description]) ||
|| a || [[#type_ARRAY8|ARRAY8]] || client-ID ||

<<Anchor(message_SaveYourself)>>
|||||| '''Save``Yourself''' ([[#protocol_SaveYourself|description]]) ||
Line 596: Line 596:
|| 1 || [#type_SAVE_TYPE SAVE_TYPE] || type ||
|| 1 || [#type_BOOL BOOL] || shutdown ||
|| 1 || [#type_INTERACT_STYLE INTERACT_STYLE] || interact-style ||
|| 1 || [#type_BOOL BOOL] || fast ||
|| 1 || [[#type_SAVE_TYPE|SAVE_TYPE]] || type ||
|| 1 || [[#type_BOOL|BOOL]] || shutdown ||
|| 1 || [[#type_INTERACT_STYLE|INTERACT_STYLE]] || interact-style ||
|| 1 || [[#type_BOOL|BOOL]] || fast ||
Line 602: Line 602:
[[Anchor(message_SaveYourselfRequest)]]
|||||| '''Save``Yourself``Request''' ([#protocol_SaveYourselfRequest description]) ||
<<Anchor(message_SaveYourselfRequest)>>
|||||| '''Save``Yourself``Request''' ([[#protocol_SaveYourselfRequest|description]]) ||
Line 609: Line 609:
|| 1 || [#type_SAVE_TYPE SAVE_TYPE] || type ||
|| 1 || [#type_BOOL BOOL
] || shutdown ||
|| 1 || [#type_INTERACT_STYLE INTERACT_STYLE] || interact-style ||
|| 1 || [#type_BOOL BOOL] || fast ||
|| 1 || [#type_BOOL BOOL] || global ||
|| 1 || [[#type_SAVE_TYPE|SAVE_TYPE]] || type ||
|| 1 || [[#type_BOOL|BOOL]
] || shutdown ||
|| 1 || [[#type_INTERACT_STYLE|INTERACT_STYLE]] || interact-style ||
|| 1 || [[#type_BOOL|BOOL]] || fast ||
|| 1 || [[#type_BOOL|BOOL]] || global ||
Line 616: Line 616:
[[Anchor(message_InteractRequest)]]
|||||| '''Interact``Request''' ([#protocol_InteractRequest description]) ||
<<Anchor(message_InteractRequest)>>
|||||| '''Interact``Request''' ([[#protocol_InteractRequest|description]]) ||
Line 621: Line 621:
|| 1 || [#type_DIALOG_TYPE DIALOG_TYPE] || dialog type || || 1 || [[#type_DIALOG_TYPE|DIALOG_TYPE]] || dialog type ||
Line 625: Line 625:
[[Anchor(message_Interact)]]
|||||| '''Interact''' ([#protocol_Interact description]) ||
<<Anchor(message_Interact)>>
|||||| '''Interact''' ([[#protocol_Interact|description]]) ||
Line 633: Line 633:
[[Anchor(message_InteractDone)]]
|||||| '''Interact``Done''' ([#protocol_InteractDone description]) ||
<<Anchor(message_InteractDone)>>
|||||| '''Interact``Done''' ([[#protocol_InteractDone|description]]) ||
Line 638: Line 638:
|| 1 || [#type_BOOL BOOL] || cancel-shutdown || || 1 || [[#type_BOOL|BOOL]] || cancel-shutdown ||
Line 642: Line 642:
[[Anchor(message_SaveYourselfDone)]]
|||||| '''Save``Yourself``Done''' ([#protocol_SaveYourselfDone description]) ||
<<Anchor(message_SaveYourselfDone)>>
|||||| '''Save``Yourself``Done''' ([[#protocol_SaveYourselfDone|description]]) ||
Line 647: Line 647:
|| 1 || [#type_BOOL BOOL] || success || || 1 || [[#type_BOOL|BOOL]] || success ||
Line 651: Line 651:
[[Anchor(message_Die)]]
|||||| '''Die''' ([#protocol_Die description]) ||
<<Anchor(message_Die)>>
|||||| '''Die''' ([[#protocol_Die|description]]) ||
Line 659: Line 659:
[[Anchor(message_ShutdownCancelled)]]
|||||| '''Shutdown``Cancelled''' ([#protocol_ShutdownCancelled description]) ||
<<Anchor(message_ShutdownCancelled)>>
|||||| '''Shutdown``Cancelled''' ([[#protocol_ShutdownCancelled|description]]) ||
Line 667: Line 667:
[[Anchor(message_ConnectionClosed)]]
|||||| '''Connection``Closed''' ([#protocol_ConnectionClosed description]) ||
<<Anchor(message_ConnectionClosed)>>
|||||| '''Connection``Closed''' ([[#protocol_ConnectionClosed|description]]) ||
Line 674: Line 674:
|| a || [#type_LISTofARRAY8 LISTofARRAY8] || reason ||

[[Anchor(message_SetProperties)]]
|||||| '''Set``Properties''' ([#protocol_SetProperties description]) ||
|| a || [[#type_LISTofARRAY8|LISTofARRAY8]] || reason ||

<<Anchor(message_SetProperties)>>
|||||| '''Set``Properties''' ([[#protocol_SetProperties|description]]) ||
Line 683: Line 683:
|| a || [#type_LISTofPROPERTY LISTofPROPERTY] || properties ||

[[Anchor(message_DeleteProperties)]]
|||||| '''Delete``Properties''' ([#protocol_DeleteProperties description]) ||
|| a || [[#type_LISTofPROPERTY|LISTofPROPERTY]] || properties ||

<<Anchor(message_DeleteProperties)>>
|||||| '''Delete``Properties''' ([[#protocol_DeleteProperties|description]]) ||
Line 692: Line 692:
|| a || [#type_LISTofARRAY8 LISTofARRAY8] || properties ||

[[Anchor(message_GetProperties)]]
|||||| '''Get``Properties''' ([#protocol_GetProperties description]) ||
|| a || [[#type_LISTofARRAY8|LISTofARRAY8]] || properties ||

<<Anchor(message_GetProperties)>>
|||||| '''Get``Properties''' ([[#protocol_GetProperties|description]]) ||
Line 702: Line 702:
[[Anchor(message_GetPropertiesReply)]]
|||||| '''Get``Properties``Reply''' ([#protocol_GetPropertiesReply description]) ||
<<Anchor(message_GetPropertiesReply)>>
|||||| '''Get``Properties``Reply''' ([[#protocol_GetPropertiesReply|description]]) ||
Line 709: Line 709:
|| a || [#type_LISTofPROPERTY LISTofPROPERTY] || properties ||

[[Anchor(message_SaveYourselfPhase2Request)]]
|||||| '''Save``Yourself``Phase``2``Request''' ([#protocol_SaveYourselfPhase2Request description]) ||
|| a || [[#type_LISTofPROPERTY|LISTofPROPERTY]] || properties ||

<<Anchor(message_SaveYourselfPhase2Request)>>
|||||| '''Save``Yourself``Phase``2``Request''' ([[#protocol_SaveYourselfPhase2Request|description]]) ||
Line 719: Line 719:
[[Anchor(message_SaveYourselfPhase2)]]
|||||| '''Save``Yourself``Phase``2''' ([#protocol_SaveYourselfPhase2 description]) ||
<<Anchor(message_SaveYourselfPhase2)>>
|||||| '''Save``Yourself``Phase``2''' ([[#protocol_SaveYourselfPhase2|description]]) ||
Line 727: Line 727:
[[Anchor(message_SaveComplete)]]
|||||| '''Save``Complete''' ([#protocol_SaveComplete description]) ||
<<Anchor(message_SaveComplete)>>
|||||| '''Save``Complete''' ([[#protocol_SaveComplete|description]]) ||
Line 737: Line 737:
All property values are stored in a [#type_LISTofARRAY8 LISTofARRAY8]. If the type of the property is CARD8, the value is stored as a [#type_LISTofARRAY8 LISTofARRAY8] with one [#type_ARRAY8 ARRAY8] that is one byte long. That single byte contains the CARD8. If the type of the property is [#type_ARRAY8 ARRAY8], the value is stored in the first element of a single element [#type_LISTofARRAY8 LISTofARRAY8].

The required properties must be set each time a client connects with the SM. The properties must be set after the client sends [#protocol_RegisterClient RegisterClient] and before the client sends SaveYourselfDone. Otherwise, the behavior of the session manager is not defined.
All property values are stored in a [[#type_LISTofARRAY8|LISTofARRAY8]]. If the type of the property is CARD8, the value is stored as a [[#type_LISTofARRAY8|LISTofARRAY8]] with one [[#type_ARRAY8|ARRAY8]] that is one byte long. That single byte contains the CARD8. If the type of the property is [[#type_ARRAY8|ARRAY8]], the value is stored in the first element of a single element [[#type_LISTofARRAY8|LISTofARRAY8]].

The required properties must be set each time a client connects with the SM. The properties must be set after the client sends [[#protocol_RegisterClient|RegisterClient]] and before the client sends SaveYourselfDone. Otherwise, the behavior of the session manager is not defined.
Line 744: Line 744:
|| [#preprop_CloneCommand CloneCommand] || OS-specific || [#type_LISTofARRAY8 LISTofARRAY8] || Yes ||
|| [#preprop_CurrentDirectory CurrentDirectory] || OS-specific || [#type_ARRAY8 ARRAY8] || No ||
|| [#preprop_DiscardCommand DiscardCommand] || OS-specific || [#type_LISTofARRAY8 LISTofARRAY8] || No* ||
|| [#preprop_Environment Environment] || OS-specific || [#type_LISTofARRAY8 LISTofARRAY8] || No ||
|| [#preprop_ProcessID ProcessID] || OS-specific || [#type_ARRAY8 ARRAY8] || No ||
|| [#preprop_Program Program] || OS-specific || [#type_ARRAY8 ARRAY8] || Yes ||
|| [#preprop_RestartCommand RestartCommand] || OS-specific || [#type_LISTofARRAY8 LISTofARRAY8] || Yes ||
|| [#preprop_ResignCommand ResignCommand] || OS-specific || [#type_LISTofARRAY8 LISTofARRAY8] || No ||
|| [#preprop_RestartStyleHint RestartStyleHint] || CARD8 || CARD8 || No ||
|| [#preprop_ShutdownCommand ShutdownCommand] || OS-specific || [#type_LISTofARRAY8 LISTofARRAY8] || No ||
|| [#preprop_UserID UserID] || [#type_ARRAY8 ARRAY8] || [#type_ARRAY8 ARRAY8] || Yes ||
|| [[#preprop_CloneCommand|CloneCommand]] || OS-specific || [[#type_LISTofARRAY8|LISTofARRAY8]] || Yes ||
|| [[#preprop_CurrentDirectory|CurrentDirectory]] || OS-specific || [[#type_ARRAY8|ARRAY8]] || No ||
|| [[#preprop_DiscardCommand|DiscardCommand]] || OS-specific || [[#type_LISTofARRAY8|LISTofARRAY8]] || No* ||
|| [[#preprop_Environment|Environment]] || OS-specific || [[#type_LISTofARRAY8|LISTofARRAY8]] || No ||
|| [[#preprop_ProcessID|ProcessID]] || OS-specific || [[#type_ARRAY8|ARRAY8]] || No ||
|| [[#preprop_Program|Program]] || OS-specific || [[#type_ARRAY8|ARRAY8]] || Yes ||
|| [[#preprop_RestartCommand|RestartCommand]] || OS-specific || [[#type_LISTofARRAY8|LISTofARRAY8]] || Yes ||
|| [[#preprop_ResignCommand|ResignCommand]] || OS-specific || [[#type_LISTofARRAY8|LISTofARRAY8]] || No ||
|| [[#preprop_RestartStyleHint|RestartStyleHint]] || CARD8 || CARD8 || No ||
|| [[#preprop_ShutdownCommand|ShutdownCommand]] || OS-specific || [[#type_LISTofARRAY8|LISTofARRAY8]] || No ||
|| [[#preprop_UserID|UserID]] || [[#type_ARRAY8|ARRAY8]] || [[#type_ARRAY8|ARRAY8]] || Yes ||
Line 757: Line 757:
[[Anchor(preprop_CloneCommand)]] <<Anchor(preprop_CloneCommand)>>
Line 759: Line 759:
 This is like the RestartCommand except it restarts a copy of the application. The only difference is that the application doesn't supply its client id at register time. On POSIX systems the type should be a [#type_LISTofARRAY8 LISTofARRAY8].

[[Anchor(preprop_CurrentDirectory)]]
 This is like the RestartCommand except it restarts a copy of the application. The only difference is that the application doesn't supply its client id at register time. On POSIX systems the type should be a [[#type_LISTofARRAY8|LISTofARRAY8]].

<<Anchor(preprop_CurrentDirectory)>>
Line 763: Line 763:
 On POSIX-based systems specifies the value of the current directory that needs to be set up prior to starting the program and should be of type [#type_ARRAY8 ARRAY8].

[[Anchor(preprop_DiscardCommand)]]
 On POSIX-based systems specifies the value of the current directory that needs to be set up prior to starting the program and should be of type [[#type_ARRAY8|ARRAY8]].

<<Anchor(preprop_DiscardCommand)>>
Line 767: Line 767:
 The discard command contains a command that when delivered to the host that the client is running on (determined from the connection), will cause it to discard any information about the current state. If this command is not specified, the SM will assume that all of the client's state is encoded in the RestartCommand. On POSIX systems the type should be [#type_LISTofARRAY8 LISTofARRAY8].

[[Anchor(preprop_Environment)]]
 The discard command contains a command that when delivered to the host that the client is running on (determined from the connection), will cause it to discard any information about the current state. If this command is not specified, the SM will assume that all of the client's state is encoded in the RestartCommand. On POSIX systems the type should be [[#type_LISTofARRAY8|LISTofARRAY8]].

<<Anchor(preprop_Environment)>>
Line 771: Line 771:
 On POSIX based systems, this will be of type [#type_LISTofARRAY8 LISTofARRAY8] where the [#type_ARRAY8 ARRAY8]s alternate between environment variable name and environment variable value.

[[Anchor(preprop_ProcessID)]]
 On POSIX based systems, this will be of type [[#type_LISTofARRAY8|LISTofARRAY8]] where the [[#type_ARRAY8|ARRAY8]]s alternate between environment variable name and environment variable value.

<<Anchor(preprop_ProcessID)>>
Line 775: Line 775:
 This specifies an OS-specific identifier for the process. On POSIX systems this should of type [#type_ARRAY8 ARRAY8] and contain the return value of getpid() turned into a Latin-1 (decimal) string.

[[Anchor(preprop_Program)]]
 This specifies an OS-specific identifier for the process. On POSIX systems this should of type [[#type_ARRAY8|ARRAY8]] and contain the return value of getpid() turned into a Latin-1 (decimal) string.

<<Anchor(preprop_Program)>>
Line 779: Line 779:
 The name of the program that is running. On POSIX systems this should be the first parameter passed to execve and should be of type [#type_ARRAY8 ARRAY8].

[[Anchor(preprop_RestartCommand)]]
 The name of the program that is running. On POSIX systems this should be the first parameter passed to execve and should be of type [[#type_ARRAY8|ARRAY8]].

<<Anchor(preprop_RestartCommand)>>
Line 783: Line 783:
 The restart command contains a command that when delivered to the host that the client is running on (determined from the connection), will cause the client to restart in its current state. On POSIX-based systems this is of type [#type_LISTofARRAY8 LISTofARRAY8] and each of the elements in the array represents an element in the argv array. This restart command should ensure that the client restarts with the specified client-ID.

[[Anchor(preprop_ResignCommand)]]
 The restart command contains a command that when delivered to the host that the client is running on (determined from the connection), will cause the client to restart in its current state. On POSIX-based systems this is of type [[#type_LISTofARRAY8|LISTofARRAY8]] and each of the elements in the array represents an element in the argv array. This restart command should ensure that the client restarts with the specified client-ID.

<<Anchor(preprop_ResignCommand)>>
Line 792: Line 792:
[[Anchor(preprop_RestartStyleHint)]] <<Anchor(preprop_RestartStyleHint)>>
Line 821: Line 821:
[[Anchor(preprop_ShutdownCommand)]] <<Anchor(preprop_ShutdownCommand)>>
Line 828: Line 828:
[[Anchor(preprop_UserID)]] <<Anchor(preprop_UserID)>>

Table of Contents

Abstract

This document specifies a protocol that facilitates the management of groups of client applications by a session manager. The session manager can cause clients to save their state, to shut down, and to be restarted into a previously saved state. This protocol is layered on top of the X.Org ICE protocol.

Definitions and Goals

The purpose of the X Session Management Protocol (XSMP) is to provide a uniform mechanism for users to save and restore their sessions. A session is a group of clients, each of which has a particular state. The session is controlled by a network service called the session manager. The session manager issues commands to its clients on behalf of the user. These commands may cause clients to save their state or to terminate. It is expected that the client will save its state in such a way that the client can be restarted at a later time and resume its operation as if it had never been terminated. A client's state might include information about the file currently being edited, the current position of the insertion point within the file, or the start of an uncommitted transaction. The means by which clients are restarted is unspecified by this protocol.

For purposes of this protocol, a client of the session manager is defined as a connection to the session manager. A client is typically, though not necessarily, a process running an application program connected to an X Window System display. However, a client may be connected to more than one X display or not be connected to any X displays at all.

This protocol is layered on top of the X Consortium's ICE protocol and relies on the ICE protocol to handle connection management and authentication.

Overview of the Protocol

Clients use XSMP to register themselves with the session manager (SM). When a client starts up, it should connect to the SM. The client should remain connected for as long as it runs. A client may resign from the session by issuing the proper protocol messages before disconnecting. Termination of the connection with-out notice will be taken as an indication that the client died unexpectedly.

Clients are expected to save their state in such a way as to allow multiple instantiations of themselves to be managed independently. A unique value called a client-ID is provided by the protocol for the purpose of disambiguating multiple instantiations of clients. Clients may use this ID, for example, as part of a file-name in which to store the state for a particular instantiation. The client-ID should be saved as part of the command used to restart this client (the RestartCommand) so that the client will retain the same ID after it is restarted. Certain small pieces of state might also be stored in the RestartCommand. For example, an X11 client might place a '-twoWindow' option in its RestartCommand to indicate that it should start up in two window mode when it is restarted.

The client finds the network address of the SM in a system-dependent way. On POSIX systems an environment variable called SESSION_MANAGER will contain a list of network IDs. Each id will contain the transport name followed by a slash and the (transport-specific) address. A TCP/IP address would look like this:

tcp/hostname:portnumber 

where the hostname is a fully qualified domain name. A Unix Domain address looks like this:

local/hostname:path

A DECnet address would look like this:

decnet/nodename::objname 

If multiple network IDs are specified, they should be separated by commas.

Rationale

Some clients may wish to manage the programs they start. For example, a mail program could start a text editor for editing the text of a mail message. A client that does this is a session manager itself; it should supply the clients it starts with the appropriate connection information (i.e., the SESSION_MANAGER environment variable) that specifies a connection to itself instead of to the top level session manager.

Each client has associated with it a list of properties. A property set by one client is not visible to any other client. These properties are used for the client to inform the SM of the client's current state. When a client initially connects to the SM, there are no properties set.

Data Types

XSMP messages contain several types of data. Both the SM and the client always send messages in their native byte order. Thus, both sides may need to byte-swap the messages received. The need to do byte swapping is determined at run-time by the ICE protocol. If an invalid value is specified for a field of any of the enumerated types, a BadValue error message must be sent by the receiver of the message to the sender of the message.

Type Name

Description

BOOL

False or True

INTERACT_STYLE

None, Errors, or Any

DIALOG_TYPE

Error or Normal

SAVE_TYPE

Global, Local, or Both

CARD8

a one-byte unsigned integer

CARD16

a two-byte unsigned integer

CARD32

a four-byte unsigned integer

ARRAY8

a sequence of CARD8s

LISTofARRAY8

a sequence of ARRAY8

PROPERTY

a property name (an ARRAY8), a type name, and a value of that type

LISTofPROPERTY

a counted collection of PROPERTYs

Protocol Setup and Message Format

To start the XSMP protocol, the client sends the server an ICE ProtocolSetup message. All XSMP mes-sages are in the standard ICE message format. The message's major opcode is assigned to XSMP by ICE at run-time. The different parties (client and SM) may be assigned different major opcodes for XSMP.

Once assigned, all XSMP messages issued by this party will use the same major opcode. The message'sminor opcode specifies which protocol message this message contains. 6. Client Identification String A client ID is a string of XPCS characters encoded in ISO Latin 1 (ISO 8859-1). No null characters areallowed in this string. The client ID string is used in the RegisterClient and RegisterClientReply messages. Client IDs consist of the pieces described below. T he ID is formed by concatenating the pieces insequence, without separator characters. All pieces are padded on the left with '0' characters so as to fill the specified length. Decimal numbers are encoded using the characters 0' through 9', and hexadecimal num-bers using the characters 0' through 9' and A' t hrough F'.

Rationale

Protocol

The protocol consists of a sequence of messages as described below. Each message type is specified by an ICE minor opcode. A given message type is sent either from a client to the session manager or from the session manager to a client; the appropriate direction is listed with each message's description. For each message type, the set of valid responses and possible error messages are listed. The ICE severity is given in parentheses following each error class.

RegisterClient

The client must send this message to the SM to register the client's existence. If a client is being restarted from a previous session, the previous-ID field must contain the client ID from the previous session. For new clients, previous-ID should be of zero length. If previous-ID is not valid, the SM will send a BadValue error message to the client. At this point the SM reverts to the register state and waits for another RegisterClient. The client should then send a RegisterClient with a null previous-ID field.

RegisterClientReply

The client-ID specifies a unique identification for this client. If the client had specified an ID in the previous-ID field of the RegisterClient message, client-ID will be identical to the previously specified ID. If previous-ID was null, client-ID will be a unique ID freshly generated by the SM. The client-ID format is specified in section 6.

If the client didn't supply a previous-ID field to the RegisterClient message, the SM must send a SaveYourself message with type = Local, shutdown = False, interact-style = None, and fast = False immediately after the RegisterClientReply. The client should respond to this like any other SaveYourself message.

SaveYourself

The SM sends this message to a client to ask it to save its state. The client writes a state file and, if necessary, uses SetProperties to inform the SM of how to restart it and how to discard the saved state. During this process it can, if allowed by interact-style, request permission to interact with the user by sending an InteractRequest message. After the state has been saved, or if it cannot be successfully saved, and the properties are appropriately set, the client sends a SaveYourselfDone message. If the client wants to save additional information after all the other clients have finished changing their own state, the client should send SaveYourselfPhase2Request instead of SaveYourselfDone. The client must then freezeinteraction with the user and wait until it receives a SaveComplete, Die, or a ShutdownCancelled message.

If interact-style is None, the client must not interact with the user while saving state. If the interact-style is Errors, the client may interact with the user only if an error condition arises. If interact-style is Any, then the client may interact with the user for any purpose. This is done by sending an InteractRequest mes-sage. The SM will send an Interact message to each client that sent an InteractRequest. The client must postpone all interaction until it gets the Interact message. When the client is done interacting it should send the SM an InteractDone message. The InteractRequest message can be sent any time after a SaveYourself and before a SaveYourselfDone.

Unusual circumstances may dictate multiple interactions. The client may initiate as many InteractRequest - Interact - InteractDone sequences as it needs before it sends SaveYourselfDone.

When a client receives SaveYourself and has not yet responded SaveYourselfDone to a previous SaveYourself, it must send a SaveYourselfDone and may then begin responding as appropriate to the newly received SaveYourself.

The type field specifies the type of information that should be saved: Global, Local, or Both. The Localtype indicates that the application must update the properties to reflect its current state, send a SaveYourselfDone and continue. Specifically it should save enough information to restore the state as seen by the user of this client. It should not affect the state as seen by other users. The Global type indicates that the user wants the client to commit all of its data to permanent, globally-accessible storage. Both indicates that the client should do both of these. If Both is specified, the client should first commit the data to permanent storage before updating its SM properties.

Examples

Advice to Implementors

The shutdown field specifies whether the system is being shut down.

Rationale
  • The interaction may be different depending on whether or not shutdown is set.

The client must save and then must prevent interaction until it receives a SaveComplete, Die, or a ShutdownCancelled, because anything the user does after the save will be lost.

The fast field specifies whether or not the client should save its state as quickly as possible. For example, ifthe SM knows that power is about to fail, it should set the fast field to True.

SaveYourselfPhase2

The SM sends this message to a client that has previously sent a SaveYourselfPhase2Request message.This message informs the client that all other clients are in a fixed state and this client can save state that is associated with other clients.

Rationale
  • Clients that manager other clients (window managers, workspace managers, etc) need to know when all clients they are managing are idle, so that the manager can save state related to each of the clients without being concerned with that state changing.

The client writes a state file, if necessary, and, if necessary, uses SetProperties to inform the SM of how to restart it and how to discard the saved state. During this process it can request permission to interact with the user by sending an InteractRequest message. This should only be done if an error occurs that requires user interaction to resolve. After the state has been saved, or if it cannot be successfully saved, and the properties are appropriately set, the client sends a SaveYourselfDone message.

SaveYourselfRequest

An application sends this to the SM to request a checkpoint. When the SM receives this request it may generate a SaveYourself message in response and it may leave the fields intact.

Example
  • A vendor of a UPS (Uninterruptible Power Supply) might include an SM client that wouldmonitor the status of the UPS and generate a fast shutdown if the power is about to be lost.

If global is set to True, then the resulting SaveYourself should be sent to all applications. If global is set to False, then the resulting SaveYourself should be sent to the application that sent the SaveYourselfRequest.

InteractRequest

During a checkpoint or session-save operation, only one client at a time might be granted the privilege of interacting with the user. The InteractRequest message causes the SM to emit an Interact message at some later time if the shutdown is not cancelled by another client first. The dialog-type field specifies either Errors, indicating that the client wants to start an error dialog or Nor-mal, meaning the client wishes to start a non-error dialog.

Interact

This message grants the client the privilege of interacting with the user. When the client is done interacting with the user it must send an InteractDone message to the SM unless a shutdown cancel is received.

Advice to Implementors

InteractDone

This message is used by a client to notify the SM that it is done interacting.

Setting the cancel-shutdown field to True indicates that the user has requested that the entire shutdown be cancelled. Cancel-shutdown may only be True if the corresponding SaveYourself message specified True for the shutdown field and Any or Errors for the interact-style field. Otherwise, cancel-shutdown must be False.

SaveYourselfDone

This message is sent by a client to indicate that all of the properties representing its state have been updated. After sending SaveYourselfDone the client must wait for a SaveComplete, ShutdownCancelled, or Die message before changing its state. If the SaveYourself operation was successful, then the client should set the success field to True; otherwise the client should set it to False.

Example
  • If a client tries to save its state and runs out of disk space, it should return False in the successfield of the SaveYourselfDone message.

SaveYourselfPhase2Request

This message is sent by a client to indicate that it needs to be informed when all the other clients are quiescent, so it can continue its state.

Die

When the SM wants a client to die it sends a Die message. Before the client dies it responds by sending a ConnectionClosed message and may then close its connection to the SM at any time.

SaveComplete

When the SM is done with a checkpoint, it will send each of the clients a SaveComplete message. The client is then free to change its state.

ShutdownCancelled

The shutdown currently in process has been aborted. The client can now continue as if the shutdown had never happened. If the client has not sent SaveYourselfDone yet, the client can either abort the save and send SaveYourselfDone with the success field set to False, or it can continue with the save and send a SaveYourselfDone with the success field set to reflect the outcome of the save.

ConnectionClosed

Specifies that the client has decided to terminate. It should be immediately followed by closing the connection.

The reason field specifies why the client is resigning from the session. It is encoded as an array of Compound Text strings. If the resignation is expected by the user, there will typically be zero ARRAY8s here. But if the client encountered an unexpected fatal error, the error message (which might otherwise be printed on stderr on a POSIX system) should be forwarded to the SM here, one ARRAY8 per line of the message. It is the responsibility of the SM to display this reason to the user.

After sending this message, the client must not send any additional XSMP messages to the SM.

Advice to Implementors
  • If additional messages are received, they should be discarded.

Rationale
  • The reason for sending the ConnectionClosed message before actually closing the connections is that some transport protocols will not provide immediate notification of connection closure.

SetProperties

Sets the specified properties to the specified values. Existing properties not specified in the SetProperties message are unaffected. Some properties have predefined semantics. See section 11, "Predefined Properties."

The protocol specification recommends that property names used for properties not defined by the standard should begin with an underscore. To prevent conflicts among organizations, additional prefixes should be chosen (for example, _KPC_F AST_SAVE_OPTION). The organizational prefixes should be registered with the X Registry. The XSMP reserves all property names not beginning with an underscore for future use.

DeleteProperties

Removes the named properties.

GetProperties

Requests that the SM respond with the values of all the properties for this client.

GetPropertiesReply

This message is sent in reply to a GetProperties message and includes the values of all the properties.

Errors

When the receiver of a message detects an error condition, the receiver sends an ICE error message to the sender. There are only two types of errors that are used by the XSMP: BadValue and BadState. These are both defined in the ICE protocol.

Any message received out-of-sequence will generate a BadState error message.

State Diagrams

These state diagrams are designed to cover all actions of both the client and the SM.

Client State Transitions

start:

register:

collect-id:

shutdown-cancelled:

idle: [Undoes any freeze of interaction with user.]

die:

freeze-interaction:

save-yourself:

waiting-for-phase2:

phase2:

interact-request:

interact:

save-yourself-done: (changing state is forbidden)

connection-closed:

Session Manager State Diagram

start:

protocol-setup:

register:

acknowledge-register:

idle:

save-yourself:

get-properties:

saving-get-properties:

saving-yourself:

start-phase2:

phase2:

save-yourself-done:

die:

Protocol Encoding

Types

BOOL

0

False

1

True

INTERACT_STYLE

0

None

1

Errors

2

Any

DIALOG_TYPE

0

Error

1

Normal

SAVE_TYPE

0

Global

1

Local

2

Both

ARRAY8

4

CARD32

length

n

LISTofCARD8

the array

p

p = pad (4 + n, 8)

LISTofARRAY8

4

CARD32

count

4

unused

a

ARRAY8

first array

b

ARRAY8

second array

.

.

.

q

ARRAY8

last array

PROPERTY

a

ARRAY8

name

b

ARRAY8

type (XPCS encoded in Latin-1, case sensitive)

c

LISTofARRAY8

values

LISTofPROPERTY

4

CARD32

count

4

unused

a

PROPERTY

first property

b

PROPERTY

second property

.

.

.

q

PROPERTY

last property

Messages

XSMP is a sub-protocol of ICE. The major opcode is assigned at run-time by ICE and is represented hereby '?'.

To start the XSMP protocol, the client sends the server an ICE ProtocolSetup message. The protocol-name field should be specified as "XSMP", the major version of the protocol is 1, the minor version is 0. These values may change if the protocol is revised. The minor version number will be incremented if thechange is compatible, otherwise the major version number will be incremented.

In ProtocolReply message sent by the session manager, the XSMP protocol defines the vendor parameteras product identification of the session manager, and defines the release parameter as the software release identification of the session manager. The session manager should supply this information in the ICE ProtocolReply message.

RegisterClient (description)

Bytes

Value

Description

1

?

XSMP

1

1

opcode

2

unused

4

a/8

length of remaining data in 8-byte units

a

ARRAY8

previous-ID

RegisterClientReply (description)

Bytes

Value

Description

1

?

XSMP

1

2

opcode

2

unused

4

a/8

length of remaining data in 8-byte units

a

ARRAY8

client-ID

SaveYourself (description)

Bytes

Value

Description

1

?

XSMP

1

3

opcode

2

unused

4

1

length of remaining data in 8-byte units

1

SAVE_TYPE

type

1

BOOL

shutdown

1

INTERACT_STYLE

interact-style

1

BOOL

fast

4

unused

SaveYourselfRequest (description)

Bytes

Value

Description

1

?

XSMP

1

4

opcode

2

unused

4

1

length of remaining data in 8-byte units

1

SAVE_TYPE

type

1

BOOL

shutdown

1

INTERACT_STYLE

interact-style

1

BOOL

fast

1

BOOL

global

3

unused

InteractRequest (description)

Bytes

Value

Description

1

?

XSMP

1

5

opcode

1

DIALOG_TYPE

dialog type

1

unused

4

0

length of remaining data in 8-byte units

Interact (description)

Bytes

Value

Description

1

?

XSMP

1

6

opcode

2

unused

4

0

length of remaining data in 8-byte units

InteractDone (description)

Bytes

Value

Description

1

?

XSMP

1

7

opcode

1

BOOL

cancel-shutdown

1

unused

4

0

length of remaining data in 8-byte units

SaveYourselfDone (description)

Bytes

Value

Description

1

?

XSMP

1

8

opcode

1

BOOL

success

1

unused

4

0

length of remaining data in 8-byte units

Die (description)

Bytes

Value

Description

1

?

XSMP

1

9

opcode

2

unused

4

0

length of remaining data in 8-byte units

ShutdownCancelled (description)

Bytes

Value

Description

1

?

XSMP

1

10

opcode

2

unused

4

0

length of remaining data in 8-byte units

ConnectionClosed (description)

Bytes

Value

Description

1

?

XSMP

1

11

opcode

2

unused

4

a/8

length of remaining data in 8-byte units

a

LISTofARRAY8

reason

SetProperties (description)

Bytes

Value

Description

1

?

XSMP

1

12

opcode

2

unused

4

a/8

length of remaining data in 8-byte units

a

LISTofPROPERTY

properties

DeleteProperties (description)

Bytes

Value

Description

1

?

XSMP

1

13

opcode

2

unused

4

a/8

length of remaining data in 8-byte units

a

LISTofARRAY8

properties

GetProperties (description)

Bytes

Value

Description

1

?

XSMP

1

14

opcode

2

unused

4

0

length of remaining data in 8-byte units

GetPropertiesReply (description)

Bytes

Value

Description

1

?

XSMP

1

15

opcode

2

unused

4

a/8

length of remaining data in 8-byte units

a

LISTofPROPERTY

properties

SaveYourselfPhase2Request (description)

Bytes

Value

Description

1

?

XSMP

1

16

opcode

2

unused

4

0

length of remaining data in 8-byte units

SaveYourselfPhase2 (description)

Bytes

Value

Description

1

?

XSMP

1

17

opcode

2

unused

4

0

length of remaining data in 8-byte units

SaveComplete (description)

Bytes

Value

Description

1

?

XSMP

1

18

opcode

2

unused

4

0

length of remaining data in 8-byte units

Predefined Properties

All property values are stored in a LISTofARRAY8. If the type of the property is CARD8, the value is stored as a LISTofARRAY8 with one ARRAY8 that is one byte long. That single byte contains the CARD8. If the type of the property is ARRAY8, the value is stored in the first element of a single element LISTofARRAY8.

The required properties must be set each time a client connects with the SM. The properties must be set after the client sends RegisterClient and before the client sends SaveYourselfDone. Otherwise, the behavior of the session manager is not defined.

Clients may set, get, and delete nonstandard properties. The lifetime of stored properties does not extend into subsequent sessions.

Name

Type

Posix Type

Required?

CloneCommand

OS-specific

LISTofARRAY8

Yes

CurrentDirectory

OS-specific

ARRAY8

No

DiscardCommand

OS-specific

LISTofARRAY8

No*

Environment

OS-specific

LISTofARRAY8

No

ProcessID

OS-specific

ARRAY8

No

Program

OS-specific

ARRAY8

Yes

RestartCommand

OS-specific

LISTofARRAY8

Yes

ResignCommand

OS-specific

LISTofARRAY8

No

RestartStyleHint

CARD8

CARD8

No

ShutdownCommand

OS-specific

LISTofARRAY8

No

UserID

ARRAY8

ARRAY8

Yes

* Required if any state is stored in an external repository (e.g., state file).

CloneCommand

  • This is like the RestartCommand except it restarts a copy of the application. The only difference is that the application doesn't supply its client id at register time. On POSIX systems the type should be a LISTofARRAY8.

CurrentDirectory

  • On POSIX-based systems specifies the value of the current directory that needs to be set up prior to starting the program and should be of type ARRAY8.

DiscardCommand

  • The discard command contains a command that when delivered to the host that the client is running on (determined from the connection), will cause it to discard any information about the current state. If this command is not specified, the SM will assume that all of the client's state is encoded in the RestartCommand. On POSIX systems the type should be LISTofARRAY8.

Environment

  • On POSIX based systems, this will be of type LISTofARRAY8 where the ARRAY8s alternate between environment variable name and environment variable value.

ProcessID

  • This specifies an OS-specific identifier for the process. On POSIX systems this should of type ARRAY8 and contain the return value of getpid() turned into a Latin-1 (decimal) string.

Program

  • The name of the program that is running. On POSIX systems this should be the first parameter passed to execve and should be of type ARRAY8.

RestartCommand

  • The restart command contains a command that when delivered to the host that the client is running on (determined from the connection), will cause the client to restart in its current state. On POSIX-based systems this is of type LISTofARRAY8 and each of the elements in the array represents an element in the argv array. This restart command should ensure that the client restarts with the specified client-ID.

ResignCommand

  • A client that sets the RestartStyleHint to RestartAnyway uses this property to specify a command that undoes the effect of the client and removes any saved state.

Example
  • A user runs xmodmap. xmodmap registers with the SM, sets RestartStyleHint to RestartAnyway, and then terminates. In order to allow the SM (at the user's request) to undo this, xmodmap would register a ResignCommand that undoes the effects of the xmodmap.

RestartStyleHint

  • If the RestartStyleHint property is present, it will contain the style of restarting the client prefers. If this flag isn't specified, RestartIfRunning is assumed. The possible values are as follows:

Name

Value

RestartIfRunning

0

RestartAnyway

1

RestartImmediately

2

RestartNever

3

  • The RestartIfRunning style is used in the usual case. The client should be restarted in the next session if it is connected to the session manager at the end of the current session.

    The RestartAnyway style is used to tell the SM that the application should be restarted in the next session even if it exits before the current session is terminated. It should be noted that this is only a hint and the SM will follow the policies specified by its users in determining what applications to restart.

Rationale
  • This can be specified by a client which supports (as MS-Windows clients do) a means forthe user to indicate while exiting that restarting is desired. It can also be used for clients that spawn other clients and then go away, but which want to be restarted.

Advice to Implementors
  • It would be wise to sanity-check the frequency which which RestartImmediately clients are restarted, to avoid a sick client being restarted continuously.

  • The RestartNever style specifies that the client does not wish to be restarted in the next session.

Advice To Implementors
  • This should be used rarely, if at all. It will cause the client to be silently left out of sessions when they are restarted and will probably be confusing to users.

ShutdownCommand

  • This command is executed at shutdown time to clean up after a client that is no longer running but retained its state by setting RestartStyleHint to RestartAnyway. The command must not remove any saved state as the client is still part of the session.

Example
  • A client is run at start up time that turns on a camera. This client then exits. At session shutdown, the user wants the camera turned off. This client would set the RestartStyleHint to RestartAnyway and would register a ShutdownCommand that would turn off the camera.

UserID

  • Specifies the user's ID. On POSIX-based systems this will contain the the user's name (the pw_name field of struct passwd).

Copyright and Licensing

X Window System is a trademark of The Open Group. Copyright (C) 1992, 1993, 1994, 2002 The Open Group.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associateddocumentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, m odify, merge, publish, distribute, sublicense, and/or sell copies of the Soft-ware, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portionsof the Software. THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE XCONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.