<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to ProcessWrapperMessageProtocol</title><link>https://sourceforge.net/p/srcdsctl/wiki/ProcessWrapperMessageProtocol/</link><description>Recent changes to ProcessWrapperMessageProtocol</description><atom:link href="https://sourceforge.net/p/srcdsctl/wiki/ProcessWrapperMessageProtocol/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 14 May 2014 03:07:32 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/srcdsctl/wiki/ProcessWrapperMessageProtocol/feed" rel="self" type="application/rss+xml"/><item><title>ProcessWrapperMessageProtocol modified by Ben Sawyer</title><link>https://sourceforge.net/p/srcdsctl/wiki/ProcessWrapperMessageProtocol/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -19,8 +19,9 @@
 STILL_ALIVE | 0x03       | Keep alive acknowledgement
 LINE        | 0x10       | A line of output from the wrapper, or a line of input from the daemon
 ERROR       | 0xA0       | Reports an error
-STOP        | 0xE0       | Instructs wrapper to stop process
-KILL        | 0xE1       | Instructs wrapper to kill process
+START       | 0xE0       | Instructs wrapper to start process
+STOP        | 0xE1       | Instructs wrapper to stop process
+KILL        | 0xE2       | Instructs wrapper to kill process
 EXIT        | 0xFF       | Instructs wrapper to exit

@@ -32,16 +33,17 @@

 Key       | Value                
 ----------|----------------------
+txId      | Transaction ID for this request
 protoVer  | The protocol version being used
-pid       | The PID of the wrapper process
+clientId  | The PID of the wrapper process

 #### ACK ####

-Acknowledges successful receipt/execution of a message.
+Acknowledges successful receipt/execution of a message.  Ack messages have varying properties depending on the type of message that is being acknowledged.

 Key       | Value                
 ----------|----------------------
-mid       | The ID of the message this message is acknowledging
+txId      | ID of the transaction this message is acknowledging

 #### KEEP_ALIVE ####

@@ -58,6 +60,7 @@
 Key       | Value                
 ----------|----------------------
 l         | The line of input/output
+txId      | The transaction ID for this request (Daemon to Wrapper only)

 #### ERROR ####

@@ -65,19 +68,94 @@

 Key       | Value                
 ----------|----------------------
-mid       | The ID of the message that requested the operation that resulted in an error (absent if error was not the result of an action requested by a message)
+txId      | The ID of the request that resulted in an error (absent if error was not the result of an action requested by a message)
 code      | The error code
-message   | (optional) The error message, if there is one
+exitCode  | (optional) The Process' exit code, if there was

 #### STOP ####

-Stop messages have no K/V pairs.
+Key       | Value                
+----------|----------------------
+txId      | Transaction ID for this request

 #### KILL ####

-Kill messages have no K/V pairs
+Key       | Value                
+----------|----------------------
+txId      | Transaction ID for this request

+#### EXIT ####
+
+Key       | Value                
+----------|----------------------
+txId      | Transaction ID for this request

 ### Message Exchanges ###

+D&gt;W and D&lt;-W      | INIT        | Start handshake
+2a       | D-&gt;W      | ACK         | Handshake successful
+2b       | D-&gt;W      | EXIT        | Sent as response if error such as protocol mismatch is encountered
+
+#### INIT Reconnect ####
+
+Sent if daemon restarts to re-establish connection with wrapper
+
+Sequence | Direction | Message/Key | Description/Value
+---------|-----------|-------------|-----------------------
+1        | D-&gt;W      | INIT        |
+2        | D&lt;-W      | ACK         | 
+
+#### START Pprocess ####
+
+Instructs wrapper to start the designated process, and establish a connection to the process' IO channels.
+
+Sequence | Direction | Message/Key | Description/Value
+---------|-----------|-------------|-----------------------
+1        | D-&gt;W      | START       |
+2        | D&lt;-W      | ACK         | Acknowledge message received
+3a       | D&lt;-W      | ACK         | Acknowledge process started successfully
+3b       | D&lt;-W      | ERROR       | If process did not start successfully
+
+#### STOP Process ####
+
+Instructs wrapper to send SIGTERM the running process
+
+Sequence | Direction | Message/Key | Description/Value
+---------|-----------|-------------|-----------------------
+1        | D-&gt;W      | STOP        |
+2a       | D&lt;-W      | ACK         | Acknowledge message received
+2b       | D&lt;-W      | ERROR       | Sent if process is not running
+3a       | D&lt;-W      | ACK         | Acknowledge process stopped successfully
+         |           |    exitCode | The process' exit code
+3c       | D&lt;-W      | ERROR       | Sent if process did not respond to stop message
+
+#### LINE From Wrapper ####
+
+This will be the most common transaction type.  We do not need guaranteed delivery for these messages, so the daemon does not sent an ACK response
+
+Sequence | Direction | Message/Key | Description/Value
+---------|-----------|-------------|-----------------------
+1        | D&lt;-W      | LINE        | 
+
+#### LINE From Daemon ####
+
+We need to ensure that commands we are trying to send to the process are getting executed, so an ACK is required
+
+Sequence | Direction | Message/Key | Description/Value
+---------|-----------|-------------|-----------------------
+1        | D-&gt;W      | LINE        |
+2        | D&lt;-W      | ACK         |
+
+
+
+
+
 Work in progress...
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ben Sawyer</dc:creator><pubDate>Wed, 14 May 2014 03:07:32 -0000</pubDate><guid>https://sourceforge.netab7c89e0669765ae86ec7237081667a52629de51</guid></item><item><title>ProcessWrapperMessageProtocol modified by Ben Sawyer</title><link>https://sourceforge.net/p/srcdsctl/wiki/ProcessWrapperMessageProtocol/</link><description>&lt;div class="markdown_content"&gt;&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#overview"&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#typeword-bytes"&gt;Type/Word Bytes&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#list-of-valid-word-bytes"&gt;List of Valid Word Bytes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#message-structures"&gt;Message Structures&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#init"&gt;INIT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#ack"&gt;ACK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#keep_alive"&gt;KEEP_ALIVE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#still_alive"&gt;STILL_ALIVE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#line"&gt;LINE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#error"&gt;ERROR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#stop"&gt;STOP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#kill"&gt;KILL&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#message-exchanges"&gt;Message Exchanges&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="overview"&gt;Overview&lt;/h3&gt;
&lt;p&gt;This article outlines the protocol for messages exchanged between the daemon and process wrapper.&lt;/p&gt;
&lt;h3 id="typeword-bytes"&gt;Type/Word Bytes&lt;/h3&gt;
&lt;p&gt;Each message contains a message type or "word" byte.  This byte defines what type of message follows, and can be used to determine how to handle or respond to a message.&lt;/p&gt;
&lt;h4 id="list-of-valid-word-bytes"&gt;List of Valid Word Bytes&lt;/h4&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Enum Name&lt;/th&gt;
&lt;th&gt;Byte Value&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;INIT&lt;/td&gt;
&lt;td&gt;0x00&lt;/td&gt;
&lt;td&gt;Used to initialize the connection between daemon and wrapper&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ACK&lt;/td&gt;
&lt;td&gt;0x01&lt;/td&gt;
&lt;td&gt;Standard acknowledgement of message receipt/execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KEEP_ALIVE&lt;/td&gt;
&lt;td&gt;0x02&lt;/td&gt;
&lt;td&gt;Standard keep alive message&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;STILL_ALIVE&lt;/td&gt;
&lt;td&gt;0x03&lt;/td&gt;
&lt;td&gt;Keep alive acknowledgement&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LINE&lt;/td&gt;
&lt;td&gt;0x10&lt;/td&gt;
&lt;td&gt;A line of output from the wrapper, or a line of input from the daemon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ERROR&lt;/td&gt;
&lt;td&gt;0xA0&lt;/td&gt;
&lt;td&gt;Reports an error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;STOP&lt;/td&gt;
&lt;td&gt;0xE0&lt;/td&gt;
&lt;td&gt;Instructs wrapper to stop process&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KILL&lt;/td&gt;
&lt;td&gt;0xE1&lt;/td&gt;
&lt;td&gt;Instructs wrapper to kill process&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EXIT&lt;/td&gt;
&lt;td&gt;0xFF&lt;/td&gt;
&lt;td&gt;Instructs wrapper to exit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="message-structures"&gt;Message Structures&lt;/h3&gt;
&lt;h4 id="init"&gt;INIT&lt;/h4&gt;
&lt;p&gt;Initializes the connection between the daemon and wrapper.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;protoVer&lt;/td&gt;
&lt;td&gt;The protocol version being used&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pid&lt;/td&gt;
&lt;td&gt;The PID of the wrapper process&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h4 id="ack"&gt;ACK&lt;/h4&gt;
&lt;p&gt;Acknowledges successful receipt/execution of a message.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;mid&lt;/td&gt;
&lt;td&gt;The ID of the message this message is acknowledging&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h4 id="keep_alive"&gt;KEEP_ALIVE&lt;/h4&gt;
&lt;p&gt;Keep alive messages have no K/V pairs.&lt;/p&gt;
&lt;h4 id="still_alive"&gt;STILL_ALIVE&lt;/h4&gt;
&lt;p&gt;Still alive messages have no K/V pairs.&lt;/p&gt;
&lt;h4 id="line"&gt;LINE&lt;/h4&gt;
&lt;p&gt;Line messages contain a single K/V pair containing the line of output being delivered from the process to the daemon, or the line of input to be sent to the process from the daemon&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;l&lt;/td&gt;
&lt;td&gt;The line of input/output&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h4 id="error"&gt;ERROR&lt;/h4&gt;
&lt;p&gt;Reports an error&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;mid&lt;/td&gt;
&lt;td&gt;The ID of the message that requested the operation that resulted in an error (absent if error was not the result of an action requested by a message)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;code&lt;/td&gt;
&lt;td&gt;The error code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;message&lt;/td&gt;
&lt;td&gt;(optional) The error message, if there is one&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h4 id="stop"&gt;STOP&lt;/h4&gt;
&lt;p&gt;Stop messages have no K/V pairs.&lt;/p&gt;
&lt;h4 id="kill"&gt;KILL&lt;/h4&gt;
&lt;p&gt;Kill messages have no K/V pairs&lt;/p&gt;
&lt;h3 id="message-exchanges"&gt;Message Exchanges&lt;/h3&gt;
&lt;p&gt;Work in progress...&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ben Sawyer</dc:creator><pubDate>Sat, 10 May 2014 01:21:16 -0000</pubDate><guid>https://sourceforge.net7a98f49efeaa063943e541e92bf18adebe725041</guid></item></channel></rss>