|
@@ -471,6 +471,73 @@
|
471
|
471
|
<li>If a channel_name is given at both communication sides and they are different, the client name is taken over and the server will log a warning message.</li>
|
472
|
472
|
</ul>
|
473
|
473
|
</div>
|
|
474
|
+<p><strong>Example:</strong></p>
|
|
475
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
|
|
476
|
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">'../..'</span><span class="p">)</span>
|
|
477
|
+
|
|
478
|
+<span class="kn">import</span> <span class="nn">report</span>
|
|
479
|
+<span class="kn">import</span> <span class="nn">socket_protocol</span>
|
|
480
|
+<span class="kn">import</span> <span class="nn">tcp_socket</span>
|
|
481
|
+<span class="kn">import</span> <span class="nn">time</span>
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="s1">'root'</span><span class="p">,</span> <span class="s1">'INFO'</span><span class="p">),</span> <span class="p">])</span>
|
|
485
|
+<span class="n">c</span> <span class="o">=</span> <span class="n">tcp_socket</span><span class="o">.</span><span class="n">tcp_client_stp</span><span class="p">(</span><span class="s1">'127.0.0.1'</span><span class="p">,</span> <span class="mi">17017</span><span class="p">)</span>
|
|
486
|
+<span class="n">sp</span> <span class="o">=</span> <span class="n">socket_protocol</span><span class="o">.</span><span class="n">pure_json_protocol</span><span class="p">(</span><span class="n">c</span><span class="p">,</span> <span class="n">channel_name</span><span class="o">=</span><span class="s1">'example_client'</span><span class="p">)</span>
|
|
487
|
+<span class="n">sp</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="n">socket_protocol</span><span class="o">.</span><span class="n">SID_READ_REQUEST</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
|
488
|
+<span class="nb">print</span><span class="p">(</span><span class="s1">'The Client received: </span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="nb">repr</span><span class="p">(</span><span class="n">sp</span><span class="o">.</span><span class="n">receive</span><span class="p">(</span><span class="n">socket_protocol</span><span class="o">.</span><span class="n">SID_READ_RESPONSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">get_data</span><span class="p">()))</span>
|
|
489
|
+</pre></div>
|
|
490
|
+</div>
|
|
491
|
+<p>and</p>
|
|
492
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
|
|
493
|
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">'../..'</span><span class="p">)</span>
|
|
494
|
+
|
|
495
|
+<span class="kn">import</span> <span class="nn">report</span>
|
|
496
|
+<span class="kn">import</span> <span class="nn">socket_protocol</span>
|
|
497
|
+<span class="kn">import</span> <span class="nn">tcp_socket</span>
|
|
498
|
+<span class="kn">import</span> <span class="nn">time</span>
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+<span class="k">def</span> <span class="nf">time_callback</span><span class="p">(</span><span class="n">msg</span><span class="p">):</span>
|
|
502
|
+ <span class="k">if</span> <span class="n">msg</span><span class="o">.</span><span class="n">get_status</span><span class="p">()</span> <span class="o">==</span> <span class="n">socket_protocol</span><span class="o">.</span><span class="n">STATUS_OKAY</span><span class="p">:</span>
|
|
503
|
+ <span class="k">return</span> <span class="n">socket_protocol</span><span class="o">.</span><span class="n">STATUS_OKAY</span><span class="p">,</span> <span class="n">time</span><span class="o">.</span><span class="n">asctime</span><span class="p">()</span>
|
|
504
|
+ <span class="k">else</span><span class="p">:</span>
|
|
505
|
+ <span class="k">return</span> <span class="n">socket_protocol</span><span class="o">.</span><span class="n">STATUS_OPERATION_NOT_PERMITTED</span><span class="p">,</span> <span class="kc">None</span>
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="s1">'root'</span><span class="p">,</span> <span class="s1">'INFO'</span><span class="p">),</span> <span class="p">])</span>
|
|
509
|
+<span class="n">s</span> <span class="o">=</span> <span class="n">tcp_socket</span><span class="o">.</span><span class="n">tcp_server_stp</span><span class="p">(</span><span class="s1">'127.0.0.1'</span><span class="p">,</span> <span class="mi">17017</span><span class="p">)</span>
|
|
510
|
+<span class="n">sp</span> <span class="o">=</span> <span class="n">socket_protocol</span><span class="o">.</span><span class="n">pure_json_protocol</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">channel_name</span><span class="o">=</span><span class="s1">'example_server'</span><span class="p">)</span>
|
|
511
|
+<span class="n">sp</span><span class="o">.</span><span class="n">register_callback</span><span class="p">(</span><span class="n">socket_protocol</span><span class="o">.</span><span class="n">SID_READ_REQUEST</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">time_callback</span><span class="p">)</span>
|
|
512
|
+
|
|
513
|
+<span class="n">i</span> <span class="o">=</span> <span class="mi">0</span>
|
|
514
|
+<span class="k">while</span> <span class="ow">not</span> <span class="n">s</span><span class="o">.</span><span class="n">is_connected</span><span class="p">()</span> <span class="ow">and</span> <span class="n">i</span> <span class="o"><=</span> <span class="mi">20</span><span class="p">:</span>
|
|
515
|
+ <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
|
|
516
|
+ <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="o">.</span><span class="mi">1</span><span class="p">)</span> <span class="c1"># wait for a connection</span>
|
|
517
|
+
|
|
518
|
+<span class="n">i</span> <span class="o">=</span> <span class="mi">0</span>
|
|
519
|
+<span class="k">while</span> <span class="n">s</span><span class="o">.</span><span class="n">is_connected</span><span class="p">()</span> <span class="ow">and</span> <span class="n">i</span> <span class="o"><=</span> <span class="mi">20</span><span class="p">:</span>
|
|
520
|
+ <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
|
|
521
|
+ <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="o">.</span><span class="mi">1</span><span class="p">)</span> <span class="c1"># wait for disconnect</span>
|
|
522
|
+</pre></div>
|
|
523
|
+</div>
|
|
524
|
+<p>Will result to the following output:</p>
|
|
525
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">803</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">socket_protocol</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">prot</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">Resetting</span> <span class="n">authentification</span> <span class="n">state</span> <span class="n">to</span> <span class="n">AUTH_STATE_UNTRUSTED_CONNECTION</span>
|
|
526
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">803</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">socket_protocol</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">prot</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">Initialisation</span> <span class="n">finished</span><span class="o">.</span>
|
|
527
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">803</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">socket_protocol</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">prot</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="n">service</span><span class="p">:</span> <span class="n">read</span> <span class="n">data</span> <span class="n">request</span><span class="p">,</span> <span class="n">data_id</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="n">status</span><span class="p">:</span> <span class="n">okay</span><span class="p">,</span> <span class="n">data</span><span class="p">:</span> <span class="s2">"None"</span>
|
|
528
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">954</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">tcp_socket</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">Connection</span> <span class="n">established</span><span class="o">...</span> <span class="p">(</span><span class="n">to</span> <span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="p">:</span><span class="mi">17017</span><span class="p">)</span>
|
|
529
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">955</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">socket_protocol</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">prot</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="n">service</span><span class="p">:</span> <span class="n">channel</span> <span class="n">name</span> <span class="n">request</span><span class="p">,</span> <span class="n">data_id</span><span class="p">:</span> <span class="n">name</span><span class="p">,</span> <span class="n">status</span><span class="p">:</span> <span class="n">okay</span><span class="p">,</span> <span class="n">data</span><span class="p">:</span> <span class="s2">"'example_client'"</span>
|
|
530
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">956</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">tcp_socket</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="s2">"(74): 7b 22 64 61 74 61 5f 69 64 22 3a 20 30 2c 20 22 73 65 72 76 69 63 65 5f 69 64 22 3a 20 38 2c 20 22 73 74 61 74 75 73 22 3a 20 30 2c 20 22 64 61 74 61 22 3a 20 22 65 78 61 6d 70 6c 65 5f 63 6c 69 65 6e 74 22 7d f5 cd dd e7"</span>
|
|
531
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">13</span><span class="p">,</span><span class="mi">004</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">tcp_socket</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-></span> <span class="s2">"(63): 7b 22 64 61 74 61 5f 69 64 22 3a 20 30 2c 20 22 73 65 72 76 69 63 65 5f 69 64 22 3a 20 31 30 2c 20 22 73 74 61 74 75 73 22 3a 20 30 2c 20 22 64 61 74 61 22 3a 20 6e 75 6c 6c 7d 45 05 7b b4"</span>
|
|
532
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">13</span><span class="p">,</span><span class="mi">057</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">stringtools</span><span class="o">.</span><span class="n">stp</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">message</span> <span class="n">identified</span> <span class="o">-</span> <span class="p">(</span><span class="mi">62</span><span class="p">):</span> <span class="mi">7</span><span class="n">b</span> <span class="mi">22</span> <span class="mi">64</span> <span class="mi">61</span> <span class="mi">74</span> <span class="mi">61</span> <span class="mi">5</span><span class="n">f</span> <span class="mi">69</span> <span class="mi">64</span> <span class="mi">22</span> <span class="mi">3</span><span class="n">a</span> <span class="mi">20</span> <span class="mi">30</span> <span class="mi">2</span><span class="n">c</span> <span class="mi">20</span> <span class="mi">22</span> <span class="mi">73</span> <span class="mi">65</span> <span class="mi">72</span> <span class="mi">76</span> <span class="mi">69</span> <span class="mi">63</span> <span class="mi">65</span> <span class="mi">5</span><span class="n">f</span> <span class="mi">69</span> <span class="mi">64</span> <span class="mi">22</span> <span class="mi">3</span><span class="n">a</span> <span class="mi">20</span> <span class="mi">39</span> <span class="mi">2</span><span class="n">c</span> <span class="mi">20</span> <span class="mi">22</span> <span class="mi">73</span> <span class="mi">74</span> <span class="mi">61</span> <span class="mi">74</span> <span class="mi">75</span> <span class="mi">73</span> <span class="mi">22</span> <span class="mi">3</span><span class="n">a</span> <span class="mi">20</span> <span class="mi">30</span> <span class="mi">2</span><span class="n">c</span> <span class="mi">20</span> <span class="mi">22</span> <span class="mi">64</span> <span class="mi">61</span> <span class="mi">74</span> <span class="mi">61</span> <span class="mi">22</span> <span class="mi">3</span><span class="n">a</span> <span class="mi">20</span> <span class="mi">6</span><span class="n">e</span> <span class="mi">75</span> <span class="mi">6</span><span class="n">c</span> <span class="mi">6</span><span class="n">c</span> <span class="mi">7</span><span class="n">d</span> <span class="mi">30</span> <span class="mi">59</span> <span class="n">be</span> <span class="mi">2</span><span class="n">f</span>
|
|
533
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">13</span><span class="p">,</span><span class="mi">058</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">tcp_socket</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">RX</span> <span class="o"><-</span> <span class="s2">"(62): 7b 22 64 61 74 61 5f 69 64 22 3a 20 30 2c 20 22 73 65 72 76 69 63 65 5f 69 64 22 3a 20 39 2c 20 22 73 74 61 74 75 73 22 3a 20 30 2c 20 22 64 61 74 61 22 3a 20 6e 75 6c 6c 7d 30 59 be 2f"</span>
|
|
534
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">13</span><span class="p">,</span><span class="mi">058</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">socket_protocol</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">prot</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">RX</span> <span class="o"><-</span> <span class="n">service</span><span class="p">:</span> <span class="n">channel</span> <span class="n">name</span> <span class="n">response</span><span class="p">,</span> <span class="n">data_id</span><span class="p">:</span> <span class="n">name</span><span class="p">,</span> <span class="n">status</span><span class="p">:</span> <span class="n">okay</span><span class="p">,</span> <span class="n">data</span><span class="p">:</span> <span class="s2">"None"</span>
|
|
535
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">13</span><span class="p">,</span><span class="mi">109</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">stringtools</span><span class="o">.</span><span class="n">stp</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">message</span> <span class="n">identified</span> <span class="o">-</span> <span class="p">(</span><span class="mi">85</span><span class="p">):</span> <span class="mi">7</span><span class="n">b</span> <span class="mi">22</span> <span class="mi">64</span> <span class="mi">61</span> <span class="mi">74</span> <span class="mi">61</span> <span class="mi">5</span><span class="n">f</span> <span class="mi">69</span> <span class="mi">64</span> <span class="mi">22</span> <span class="mi">3</span><span class="n">a</span> <span class="mi">20</span> <span class="mi">30</span> <span class="mi">2</span><span class="n">c</span> <span class="mi">20</span> <span class="mi">22</span> <span class="mi">73</span> <span class="mi">65</span> <span class="mi">72</span> <span class="mi">76</span> <span class="mi">69</span> <span class="mi">63</span> <span class="mi">65</span> <span class="mi">5</span><span class="n">f</span> <span class="mi">69</span> <span class="mi">64</span> <span class="mi">22</span> <span class="mi">3</span><span class="n">a</span> <span class="mi">20</span> <span class="mi">31</span> <span class="mi">31</span> <span class="mi">2</span><span class="n">c</span> <span class="mi">20</span> <span class="mi">22</span> <span class="mi">73</span> <span class="mi">74</span> <span class="mi">61</span> <span class="mi">74</span> <span class="mi">75</span> <span class="mi">73</span> <span class="mi">22</span> <span class="mi">3</span><span class="n">a</span> <span class="mi">20</span> <span class="mi">30</span> <span class="mi">2</span><span class="n">c</span> <span class="mi">20</span> <span class="mi">22</span> <span class="mi">64</span> <span class="mi">61</span> <span class="mi">74</span> <span class="mi">61</span> <span class="mi">22</span> <span class="mi">3</span><span class="n">a</span> <span class="mi">20</span> <span class="mi">22</span> <span class="mi">4</span><span class="n">d</span> <span class="mi">6</span><span class="n">f</span> <span class="mi">6</span><span class="n">e</span> <span class="mi">20</span> <span class="mi">4</span><span class="n">a</span> <span class="mi">61</span> <span class="mi">6</span><span class="n">e</span> <span class="mi">20</span> <span class="mi">31</span> <span class="mi">31</span> <span class="mi">20</span> <span class="mi">31</span> <span class="mi">37</span> <span class="mi">3</span><span class="n">a</span> <span class="mi">34</span> <span class="mi">30</span> <span class="mi">3</span><span class="n">a</span> <span class="mi">31</span> <span class="mi">33</span> <span class="mi">20</span> <span class="mi">32</span> <span class="mi">30</span> <span class="mi">32</span> <span class="mi">31</span> <span class="mi">22</span> <span class="mi">7</span><span class="n">d</span> <span class="n">dd</span> <span class="mi">78</span> <span class="mi">8</span><span class="n">e</span> <span class="n">ae</span>
|
|
536
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">13</span><span class="p">,</span><span class="mi">109</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">tcp_socket</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">comm</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">RX</span> <span class="o"><-</span> <span class="s2">"(85): 7b 22 64 61 74 61 5f 69 64 22 3a 20 30 2c 20 22 73 65 72 76 69 63 65 5f 69 64 22 3a 20 31 31 2c 20 22 73 74 61 74 75 73 22 3a 20 30 2c 20 22 64 61 74 61 22 3a 20 22 4d 6f 6e 20 4a 61 6e 20 31 31 20 31 37 3a 34 30 3a 31 33 20 32 30 32 31 22 7d dd 78 8e ae"</span>
|
|
537
|
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">11</span> <span class="mi">17</span><span class="p">:</span><span class="mi">40</span><span class="p">:</span><span class="mi">13</span><span class="p">,</span><span class="mi">110</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">socket_protocol</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">prot</span><span class="o">-</span><span class="n">client</span><span class="p">:</span> <span class="n">RX</span> <span class="o"><-</span> <span class="n">service</span><span class="p">:</span> <span class="n">read</span> <span class="n">data</span> <span class="n">response</span><span class="p">,</span> <span class="n">data_id</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="n">status</span><span class="p">:</span> <span class="n">okay</span><span class="p">,</span> <span class="n">data</span><span class="p">:</span> <span class="s2">"'Mon Jan 11 17:40:13 2021'"</span>
|
|
538
|
+<span class="n">The</span> <span class="n">Client</span> <span class="n">received</span><span class="p">:</span> <span class="s1">'Mon Jan 11 17:40:13 2021'</span>
|
|
539
|
+</pre></div>
|
|
540
|
+</div>
|
474
|
541
|
<dl class="method">
|
475
|
542
|
<dt id="socket_protocol.pure_json_protocol.add_data">
|
476
|
543
|
<code class="descname">add_data</code><span class="sig-paren">(</span><em>service_id</em>, <em>data_id</em>, <em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#socket_protocol.pure_json_protocol.add_data" title="Permalink to this definition">¶</a></dt>
|