<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Messages on sillysky.net</title>
    <link>https://sillysky.net/docs/nyssr/messages/</link>
    <description>Recent content in Messages on sillysky.net</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 14 Oct 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://sillysky.net/docs/nyssr/messages/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>CMessage</title>
      <link>https://sillysky.net/docs/nyssr/messages/cmessage/</link>
      <pubDate>Tue, 14 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://sillysky.net/docs/nyssr/messages/cmessage/</guid>
      <description>&lt;p&gt;&lt;code&gt;CMessage&lt;/code&gt; is simply a container for the classes &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cenvelope/&#34;&gt;CEnvelope&lt;/a&gt; and&#xA;&lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/crecord/&#34;&gt;CRecord&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;constructors&#34;&gt;Constructors&lt;/h2&gt;&#xA;&lt;p&gt;There are two constructors for the class. The first one takes over the given&#xA;components:&lt;/p&gt;&#xA;&lt;pre class=&#34;ss-javacode&#34;&gt;&lt;code class=&#34;language-java&#34;&gt;public &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cmessage/&#34;&gt;CMessage&lt;/a&gt;(@NotNull final &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cenvelope/&#34;&gt;CEnvelope&lt;/a&gt; aEnvelope,&#xA;                @NotNull final &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/crecord/&#34;&gt;CRecord&lt;/a&gt; aRecord);&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second constructor takes a template and is actually a copy constructor:&lt;/p&gt;&#xA;&lt;pre class=&#34;ss-javacode&#34;&gt;&lt;code class=&#34;language-java&#34;&gt;public &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cmessage/&#34;&gt;CMessage&lt;/a&gt;(@NotNull final &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cmessage/&#34;&gt;CMessage&lt;/a&gt; aTemplate);&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2 id=&#34;stream&#34;&gt;Stream&lt;/h2&gt;&#xA;&lt;p&gt;Furthermore, there is a static method for reading the message from a&#xA;&lt;code&gt;DataInput&lt;/code&gt; stream:&lt;/p&gt;&#xA;&lt;pre class=&#34;ss-javacode&#34;&gt;&lt;code class=&#34;language-java&#34;&gt;public static &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cmessage/&#34;&gt;CMessage&lt;/a&gt; fromStream(@NotNull final DataInput aStream) throws IOException;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Accordingly, there is also a method for writing to a &lt;code&gt;DataOutput&lt;/code&gt; stream:&lt;/p&gt;</description>
    </item>
    <item>
      <title>IMessageSender</title>
      <link>https://sillysky.net/docs/nyssr/messages/imessagesender/</link>
      <pubDate>Tue, 14 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://sillysky.net/docs/nyssr/messages/imessagesender/</guid>
      <description>&lt;p&gt;The message sender is the service that can send &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cmessage/&#34;&gt;messages&lt;/a&gt;. There are&#xA;also methods for sending messages in &lt;a href=&#34;https://sillysky.net/docs/nyssr/namespaces/targets/itarget/&#34;&gt;targets&lt;/a&gt;, but these also use&#xA;the message sender internally.&lt;/p&gt;&#xA;&lt;p&gt;The message sender is available as a service via the &lt;a href=&#34;https://sillysky.net/docs/nyssr/services/serviceregistry/&#34;&gt;service registry&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;pre class=&#34;ss-javacode&#34;&gt;&lt;code class=&#34;language-java&#34;&gt;final &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/imessagesender/&#34;&gt;IMessageSender&lt;/a&gt; messageSender = &lt;a href=&#34;https://sillysky.net/docs/nyssr/services/serviceregistry/&#34;&gt;CServiceRegistry&lt;/a&gt;.getInstance()&#xA;                                                     .getService(&lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/imessagesender/&#34;&gt;IMessageSender&lt;/a&gt;.class);&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2 id=&#34;send-messages&#34;&gt;Send messages&lt;/h2&gt;&#xA;&lt;p&gt;The methods for sending &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cmessage/&#34;&gt;messages&lt;/a&gt; are always executed in pairs.&#xA;While one method receives a complete &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cmessage/&#34;&gt;message&lt;/a&gt;, the second method&#xA;always receives the components of the message.&lt;/p&gt;&#xA;&lt;pre class=&#34;ss-javacode&#34;&gt;&lt;code class=&#34;language-java&#34;&gt;void send(@NotNull &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cmessage/&#34;&gt;CMessage&lt;/a&gt; aMsg) throws &lt;a href=&#34;https://sillysky.net/docs/nyssr/other-interfaces/cexception/&#34;&gt;CException&lt;/a&gt;;&#xA;void send(@NotNull &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cenvelope/&#34;&gt;CEnvelope&lt;/a&gt; aEnvelope,&#xA;          @NotNull &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/crecord/&#34;&gt;CRecord&lt;/a&gt; aRecord) throws &lt;a href=&#34;https://sillysky.net/docs/nyssr/other-interfaces/cexception/&#34;&gt;CException&lt;/a&gt;;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2 id=&#34;send-requests&#34;&gt;Send requests&lt;/h2&gt;&#xA;&lt;p&gt;If you want to receive a response to the message, you should set the&#xA;corresponding &lt;a href=&#34;https://sillysky.net/docs/nyssr/messages/cenvelope/#ankerReply&#34;&gt;flag&lt;/a&gt; in the envelope. By default, this&#xA;flag is not set. These methods set the flag before the message is sent.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
