<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.14">
  <compounddef id="ClientComm_8h" kind="file" language="C++">
    <compoundname>ClientComm.h</compoundname>
    <includes refid="tools_8h" local="no">../tools.h</includes>
    <includes refid="CommBase_8h" local="no">CommBase.h</includes>
    <includes refid="DefaultComm_8h" local="no">DefaultComm.h</includes>
    <includes refid="comm__header_8h" local="no">comm_header.h</includes>
    <includedby refid="communication_8h" local="no">/root/cis_interface/cis_interface/cis_interface/communication/communication.h</includedby>
    <incdepgraph>
      <node id="56">
        <label>stdint.h</label>
        <link refid="stdint_8h_source"/>
        <childnode refid="57" relation="include">
        </childnode>
        <childnode refid="58" relation="include">
        </childnode>
      </node>
      <node id="51">
        <label>stdarg.h</label>
      </node>
      <node id="64">
        <label>../dataio/AsciiTable.h</label>
        <link refid="AsciiTable_8h_source"/>
        <childnode refid="47" relation="include">
        </childnode>
        <childnode refid="65" relation="include">
        </childnode>
      </node>
      <node id="50">
        <label>stdlib.h</label>
      </node>
      <node id="52">
        <label>errno.h</label>
      </node>
      <node id="58">
        <label>stddef.h</label>
      </node>
      <node id="47">
        <label>../tools.h</label>
        <link refid="tools_8h_source"/>
        <childnode refid="48" relation="include">
        </childnode>
        <childnode refid="49" relation="include">
        </childnode>
        <childnode refid="50" relation="include">
        </childnode>
        <childnode refid="51" relation="include">
        </childnode>
        <childnode refid="52" relation="include">
        </childnode>
        <childnode refid="53" relation="include">
        </childnode>
        <childnode refid="54" relation="include">
        </childnode>
        <childnode refid="56" relation="include">
        </childnode>
        <childnode refid="59" relation="include">
        </childnode>
      </node>
      <node id="65">
        <label>AsciiFile.h</label>
        <link refid="AsciiFile_8h_source"/>
        <childnode refid="47" relation="include">
        </childnode>
      </node>
      <node id="63">
        <label>comm_header.h</label>
        <link refid="comm__header_8h_source"/>
        <childnode refid="47" relation="include">
        </childnode>
        <childnode refid="64" relation="include">
        </childnode>
      </node>
      <node id="57">
        <label>wchar.h</label>
      </node>
      <node id="48">
        <label>string.h</label>
      </node>
      <node id="60">
        <label>CommBase.h</label>
        <link refid="CommBase_8h_source"/>
        <childnode refid="47" relation="include">
        </childnode>
      </node>
      <node id="59">
        <label>unistd.h</label>
      </node>
      <node id="62">
        <label>ZMQComm.h</label>
        <link refid="ZMQComm_8h_source"/>
        <childnode refid="60" relation="include">
        </childnode>
        <childnode refid="63" relation="include">
        </childnode>
      </node>
      <node id="61">
        <label>DefaultComm.h</label>
        <link refid="DefaultComm_8h_source"/>
        <childnode refid="60" relation="include">
        </childnode>
        <childnode refid="62" relation="include">
        </childnode>
      </node>
      <node id="54">
        <label>regex_posix.h</label>
        <link refid="regex__posix_8h_source"/>
        <childnode refid="55" relation="include">
        </childnode>
        <childnode refid="56" relation="include">
        </childnode>
      </node>
      <node id="53">
        <label>time.h</label>
      </node>
      <node id="46">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h</label>
        <link refid="ClientComm_8h"/>
        <childnode refid="47" relation="include">
        </childnode>
        <childnode refid="60" relation="include">
        </childnode>
        <childnode refid="61" relation="include">
        </childnode>
        <childnode refid="63" relation="include">
        </childnode>
      </node>
      <node id="55">
        <label>regex.h</label>
      </node>
      <node id="49">
        <label>stdio.h</label>
      </node>
    </incdepgraph>
    <invincdepgraph>
      <node id="70">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/PsiInterface.hpp</label>
        <link refid="PsiInterface_8hpp_source"/>
      </node>
      <node id="68">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/CisInterface.h</label>
        <link refid="CisInterface_8h_source"/>
        <childnode refid="69" relation="include">
        </childnode>
        <childnode refid="71" relation="include">
        </childnode>
      </node>
      <node id="71">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/PsiInterface.h</label>
        <link refid="PsiInterface_8h_source"/>
      </node>
      <node id="69">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/CisInterface.hpp</label>
        <link refid="CisInterface_8hpp_source"/>
        <childnode refid="70" relation="include">
        </childnode>
      </node>
      <node id="66">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h</label>
        <link refid="ClientComm_8h"/>
        <childnode refid="67" relation="include">
        </childnode>
      </node>
      <node id="67">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/communication.h</label>
        <link refid="communication_8h_source"/>
        <childnode refid="68" relation="include">
        </childnode>
        <childnode refid="71" relation="include">
        </childnode>
      </node>
    </invincdepgraph>
      <sectiondef kind="var">
      <memberdef kind="variable" id="ClientComm_8h_1a896164631edd457a93b14c71f97a4015" prot="public" static="yes" mutable="no">
        <type>unsigned</type>
        <definition>unsigned _client_rand_seeded</definition>
        <argsstring></argsstring>
        <name>_client_rand_seeded</name>
        <initializer>= 0</initializer>
        <briefdescription>
<para>Flag for checking if this header has already been included. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="16" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="16" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="ClientComm_8h_1a99e164c22d3655374709708f153acf2c" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int new_client_address</definition>
        <argsstring>(comm_t *comm)</argsstring>
        <name>new_client_address</name>
        <param>
          <type><ref refid="structcomm__t" kindref="compound">comm_t</ref> *</type>
          <declname>comm</declname>
        </param>
        <briefdescription>
<para>Create a new channel. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">comm</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__t" kindref="compound">comm_t</ref> * Comm structure initialized with new_comm_base. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int -1 if the address could not be created. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="24" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="24" bodyend="31"/>
      </memberdef>
      <memberdef kind="function" id="ClientComm_8h_1ab7c7f53e329f398bfffc66d699d163bf" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int init_client_comm</definition>
        <argsstring>(comm_t *comm)</argsstring>
        <name>init_client_comm</name>
        <param>
          <type><ref refid="structcomm__t" kindref="compound">comm_t</ref> *</type>
          <declname>comm</declname>
        </param>
        <briefdescription>
<para>Initialize a client communicator. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">comm</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__t" kindref="compound">comm_t</ref> * Comm structure initialized with init_comm_base. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int -1 if the comm could not be initialized. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="39" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="39" bodyend="85"/>
      </memberdef>
      <memberdef kind="function" id="ClientComm_8h_1afad4b032f846a1d7943cbb6ea7c23590" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int get_client_response_count</definition>
        <argsstring>(const comm_t x)</argsstring>
        <name>get_client_response_count</name>
        <param>
          <type>const <ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
          <declname>x</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="88" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="88" bodyend="95"/>
      </memberdef>
      <memberdef kind="function" id="ClientComm_8h_1a2265ae63da94bfd1b311f29f0152dabd" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>void</type>
        <definition>static void set_client_response_count</definition>
        <argsstring>(const comm_t x, const int new_val)</argsstring>
        <name>set_client_response_count</name>
        <param>
          <type>const <ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
          <declname>x</declname>
        </param>
        <param>
          <type>const int</type>
          <declname>new_val</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="98" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="98" bodyend="104"/>
      </memberdef>
      <memberdef kind="function" id="ClientComm_8h_1ae56afc923f90fdc2cae2c851a3e90e73" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>void</type>
        <definition>static void inc_client_response_count</definition>
        <argsstring>(const comm_t x)</argsstring>
        <name>inc_client_response_count</name>
        <param>
          <type>const <ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
          <declname>x</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="107" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="107" bodyend="113"/>
      </memberdef>
      <memberdef kind="function" id="ClientComm_8h_1ad5112f3eb4629a85dc677ffb8401a5b5" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>void</type>
        <definition>static void dec_client_response_count</definition>
        <argsstring>(const comm_t x)</argsstring>
        <name>dec_client_response_count</name>
        <param>
          <type>const <ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
          <declname>x</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="116" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="116" bodyend="122"/>
      </memberdef>
      <memberdef kind="function" id="ClientComm_8h_1aa22e3821fabf68575b308ca96e474be7" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>void</type>
        <definition>static void free_client_response_count</definition>
        <argsstring>(comm_t *x)</argsstring>
        <name>free_client_response_count</name>
        <param>
          <type><ref refid="structcomm__t" kindref="compound">comm_t</ref> *</type>
          <declname>x</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="125" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="125" bodyend="132"/>
      </memberdef>
      <memberdef kind="function" id="ClientComm_8h_1a49990dcb441152cd77c010e38991cbe2" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int free_client_comm</definition>
        <argsstring>(comm_t *x)</argsstring>
        <name>free_client_comm</name>
        <param>
          <type><ref refid="structcomm__t" kindref="compound">comm_t</ref> *</type>
          <declname>x</declname>
        </param>
        <briefdescription>
<para>Perform deallocation for client communicator. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">x</parametername>
</parameternamelist>
<parameterdescription>
<para>comm_t* Pointer to communicator to deallocate. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int 1 if there is and error, 0 otherwise. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="140" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="140" bodyend="168"/>
      </memberdef>
      <memberdef kind="function" id="ClientComm_8h_1a28e1efb8eba77f6de8fee6ba338c0d91" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int client_comm_nmsg</definition>
        <argsstring>(const comm_t x)</argsstring>
        <name>client_comm_nmsg</name>
        <param>
          <type>const <ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
          <declname>x</declname>
        </param>
        <briefdescription>
<para>Get number of messages in the comm. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">x</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__t" kindref="compound">comm_t</ref> Communicator to check. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int Number of messages. -1 indicates an error. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="176" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="176" bodyend="180"/>
      </memberdef>
      <memberdef kind="function" id="ClientComm_8h_1a6625558dfa8076f839db651ee85cf200" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref></type>
        <definition>static comm_head_t client_response_header</definition>
        <argsstring>(comm_t x, comm_head_t head)</argsstring>
        <name>client_response_header</name>
        <param>
          <type><ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
          <declname>x</declname>
        </param>
        <param>
          <type><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref></type>
          <declname>head</declname>
        </param>
        <briefdescription>
<para>Create response comm and add info to header. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">x</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__t" kindref="compound">comm_t</ref> structure that header will be sent to. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">head</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref> Prexisting header structure. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref> Header structure that includes the additional information about the response comm. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="190" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="190" bodyend="226"/>
      </memberdef>
      <memberdef kind="function" id="ClientComm_8h_1a88a5e56c9e5241dfdd18d15ac0cdd2bd" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int client_comm_send</definition>
        <argsstring>(comm_t x, const char *data, const size_t len)</argsstring>
        <name>client_comm_send</name>
        <param>
          <type><ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
          <declname>x</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>data</declname>
        </param>
        <param>
          <type>const size_t</type>
          <declname>len</declname>
        </param>
        <briefdescription>
<para>Send a message to the comm. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">x</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__t" kindref="compound">comm_t</ref> structure that comm should be sent to. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">data</parametername>
</parameternamelist>
<parameterdescription>
<para>character pointer to message that should be sent. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">len</parametername>
</parameternamelist>
<parameterdescription>
<para>size_t length of message to be sent. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int 0 if send succesfull, -1 if send unsuccessful. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="236" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="236" bodyend="249"/>
      </memberdef>
      <memberdef kind="function" id="ClientComm_8h_1a471d0ade73198a34f82a00d7ff3f9513" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int client_comm_recv</definition>
        <argsstring>(comm_t x, char **data, const size_t len, const int allow_realloc)</argsstring>
        <name>client_comm_recv</name>
        <param>
          <type><ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
          <declname>x</declname>
        </param>
        <param>
          <type>char **</type>
          <declname>data</declname>
        </param>
        <param>
          <type>const size_t</type>
          <declname>len</declname>
        </param>
        <param>
          <type>const int</type>
          <declname>allow_realloc</declname>
        </param>
        <briefdescription>
<para>Receive a message from an input comm. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">x</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__t" kindref="compound">comm_t</ref> structure that message should be sent to. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="out">data</parametername>
</parameternamelist>
<parameterdescription>
<para>char ** pointer to allocated buffer where the message should be saved. This should be a malloc&apos;d buffer if allow_realloc is 1. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">len</parametername>
</parameternamelist>
<parameterdescription>
<para>const size_t length of the allocated message buffer in bytes. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">allow_realloc</parametername>
</parameternamelist>
<parameterdescription>
<para>const int If 1, the buffer will be realloced if it is not large enought. Otherwise an error will be returned. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int -1 if message could not be received. Length of the received message if message was received. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" line="263" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h" bodystart="263" bodyend="286"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"></codeline>
<codeline lineno="2"><highlight class="preprocessor">#ifndef<sp/>CISCLIENTCOMM_H_</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>CISCLIENTCOMM_H_</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;../tools.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;CommBase.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;DefaultComm.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;comm_header.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="9"><highlight class="normal"></highlight></codeline>
<codeline lineno="10"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>__cplusplus<sp/></highlight><highlight class="comment">/*<sp/>If<sp/>this<sp/>is<sp/>a<sp/>C++<sp/>compiler,<sp/>use<sp/>C<sp/>linkage<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight><highlight class="keyword">extern</highlight><highlight class="normal"><sp/></highlight><highlight class="stringliteral">&quot;C&quot;</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="12"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="13"><highlight class="normal"></highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Handle<sp/>is<sp/>send<sp/>address</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Info<sp/>is<sp/>response</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/>_client_rand_seeded<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>new_client_address(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*comm)<sp/>{</highlight></codeline>
<codeline lineno="25"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!(_client_rand_seeded))<sp/>{</highlight></codeline>
<codeline lineno="26"><highlight class="normal"><sp/><sp/><sp/><sp/>srand(ptr2seed(comm));</highlight></codeline>
<codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/>_client_rand_seeded<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="28"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="29"><highlight class="normal"><sp/><sp/>comm-&gt;<ref refid="structcomm__t_1a9bd691f3ae56e098b9edff7ad1628b3b" kindref="member">type</ref><sp/>=<sp/>_default_comm;</highlight></codeline>
<codeline lineno="30"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>new_default_address(comm);</highlight></codeline>
<codeline lineno="31"><highlight class="normal">};</highlight></codeline>
<codeline lineno="32"><highlight class="normal"></highlight></codeline>
<codeline lineno="38"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>init_client_comm(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*comm)<sp/>{</highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!(_client_rand_seeded))<sp/>{</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/>srand(ptr2seed(comm));</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/>_client_rand_seeded<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Called<sp/>to<sp/>create<sp/>temp<sp/>comm<sp/>for<sp/>send/recv</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((strlen(comm-&gt;<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>)<sp/>==<sp/>0)<sp/>&amp;&amp;<sp/>(strlen(comm-&gt;<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>)<sp/>&gt;<sp/>0))<sp/>{</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/>comm-&gt;<ref refid="structcomm__t_1a9bd691f3ae56e098b9edff7ad1628b3b" kindref="member">type</ref><sp/>=<sp/>_default_comm;</highlight></codeline>
<codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>init_default_comm(comm);</highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Called<sp/>to<sp/>initialize/create<sp/>client<sp/>comm</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*seri_out<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*)malloc(strlen(comm-&gt;<ref refid="structcomm__t_1a1940bbad161f8cf5f868ff4cf4e95cda" kindref="member">direction</ref>)<sp/>+<sp/>1);</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(seri_out<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;init_client_comm:<sp/>Failed<sp/>to<sp/>malloc<sp/>output<sp/>serializer.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/>strcpy(seri_out,<sp/>comm-&gt;<ref refid="structcomm__t_1a1940bbad161f8cf5f868ff4cf4e95cda" kindref="member">direction</ref>);</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*handle;</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(comm-&gt;<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>)<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/>handle<sp/>=<sp/>new_comm_base(comm-&gt;<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>,<sp/></highlight><highlight class="stringliteral">&quot;send&quot;</highlight><highlight class="normal">,<sp/>_default_comm,<sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)seri_out);</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/>sprintf(handle-&gt;<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/></highlight><highlight class="stringliteral">&quot;client_request.%s&quot;</highlight><highlight class="normal">,<sp/>comm-&gt;<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/>handle<sp/>=<sp/>init_comm_base(comm-&gt;<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/></highlight><highlight class="stringliteral">&quot;send&quot;</highlight><highlight class="normal">,<sp/>_default_comm,<sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)seri_out);</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>init_default_comm(handle);</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/>strcpy(comm-&gt;<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>,<sp/>handle-&gt;<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>);</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/>comm-&gt;<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)handle;</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Keep<sp/>track<sp/>of<sp/>response<sp/>comms</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*ncomm<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)malloc(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ncomm<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;init_client_comm:<sp/>Failed<sp/>to<sp/>malloc<sp/>ncomm.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/>ncomm[0]<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/>handle-&gt;<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)ncomm;</highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/>strcpy(comm-&gt;<ref refid="structcomm__t_1a1940bbad161f8cf5f868ff4cf4e95cda" kindref="member">direction</ref>,<sp/></highlight><highlight class="stringliteral">&quot;send&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/>comm-&gt;<ref refid="structcomm__t_1a9810578a787d8503b00bcb78a592073d" kindref="member">always_send_header</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>***info<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>***)malloc(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structcomm__t" kindref="compound">comm_t</ref>**));</highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(info<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;init_client_comm:<sp/>Failed<sp/>to<sp/>malloc<sp/>info.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/>info[0]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/>comm-&gt;<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)info;</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="85"><highlight class="normal">};</highlight></codeline>
<codeline lineno="86"><highlight class="normal"></highlight></codeline>
<codeline lineno="87"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="88"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>get_client_response_count(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x)<sp/>{</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*handle<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>*)(x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>);</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>out<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(handle<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/>out<sp/>=<sp/>((</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)(handle-&gt;<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref>))[0];</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>out;</highlight></codeline>
<codeline lineno="95"><highlight class="normal">};</highlight></codeline>
<codeline lineno="96"><highlight class="normal"></highlight></codeline>
<codeline lineno="97"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="98"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>set_client_response_count(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>new_val)<sp/>{</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*handle<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>*)(x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>);</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(handle<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*count<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)(handle-&gt;<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref>);</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/>count[0]<sp/>=<sp/>new_val;</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="104"><highlight class="normal">};</highlight></codeline>
<codeline lineno="105"><highlight class="normal"></highlight></codeline>
<codeline lineno="106"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="107"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>inc_client_response_count(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x)<sp/>{</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*handle<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>*)(x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>);</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(handle<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*count<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)(handle-&gt;<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref>);</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/>count[0]++;</highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="113"><highlight class="normal">};</highlight></codeline>
<codeline lineno="114"><highlight class="normal"></highlight></codeline>
<codeline lineno="115"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="116"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>dec_client_response_count(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x)<sp/>{</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*handle<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>*)(x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>);</highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(handle<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*count<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)(handle-&gt;<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref>);</highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/>count[0]--;</highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="122"><highlight class="normal">};</highlight></codeline>
<codeline lineno="123"><highlight class="normal"></highlight></codeline>
<codeline lineno="124"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="125"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>free_client_response_count(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*x)<sp/>{</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*handle<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>*)(x-&gt;<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>);</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(handle<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*count<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)(handle-&gt;<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref>);</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/>free(count);</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/>handle-&gt;<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="132"><highlight class="normal">};</highlight></codeline>
<codeline lineno="133"><highlight class="normal"></highlight></codeline>
<codeline lineno="139"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="140"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>free_client_comm(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*x)<sp/>{</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x-&gt;<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>***info<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>***)(x-&gt;<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref>);</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(info[0]<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ncomm<sp/>=<sp/>get_client_response_count(*x);</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>ncomm;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(info[0][i]<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free_default_comm(info[0][i]);</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>free_comm_base(info[0][i]);</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(info[0][i]);</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>free(*info);</highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>info[0]<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/>free(info);</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/>x-&gt;<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/>free_client_response_count(x);</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x-&gt;<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*handle<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>*)(x-&gt;<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>);</highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/>free_default_comm(handle);</highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/>free_comm_base(handle);</highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/>free(x-&gt;<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>);</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/>x-&gt;<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="168"><highlight class="normal">};</highlight></codeline>
<codeline lineno="169"><highlight class="normal"></highlight></codeline>
<codeline lineno="175"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="176"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>client_comm_nmsg(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x)<sp/>{</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*handle<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>*)(x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>);</highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>default_comm_nmsg(*handle);</highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="180"><highlight class="normal">};</highlight></codeline>
<codeline lineno="181"><highlight class="normal"></highlight></codeline>
<codeline lineno="189"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="190"><highlight class="normal"><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref><sp/>client_response_header(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x,<sp/><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref><sp/>head)<sp/>{</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Initialize<sp/>new<sp/>comm</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ncomm<sp/>=<sp/>get_client_response_count(x);</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>***res_comm<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>***)(x.<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref>);</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/>res_comm[0]<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>**)realloc(res_comm[0],<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structcomm__t" kindref="compound">comm_t</ref>*)*(ncomm<sp/>+<sp/>1));</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(res_comm[0]<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;client_response_header:<sp/>Failed<sp/>to<sp/>realloc<sp/>response<sp/>comm.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/>head.<ref refid="structcomm__head__t_1a541f991a66b2422bec7b1cc25b5dd567" kindref="member">valid</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>head;</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*seri_copy<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*)malloc(strlen((</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*)(x.<ref refid="structcomm__t_1a2c1ca12d0df5193d4a023301aa156e8f" kindref="member">serializer</ref>-&gt;<ref refid="structseri__t_1afe8d056809d1f3155b50603a620a52ab" kindref="member">info</ref>))<sp/>+<sp/>1);</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(seri_copy<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;client_response_header:<sp/>Failed<sp/>to<sp/>malloc<sp/>copy<sp/>of<sp/>serializer<sp/>info.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/>head.<ref refid="structcomm__head__t_1a541f991a66b2422bec7b1cc25b5dd567" kindref="member">valid</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>head;</highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/>strcpy(seri_copy,<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*)(x.<ref refid="structcomm__t_1a2c1ca12d0df5193d4a023301aa156e8f" kindref="member">serializer</ref>-&gt;<ref refid="structseri__t_1afe8d056809d1f3155b50603a620a52ab" kindref="member">info</ref>));</highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/>res_comm[0][ncomm]<sp/>=<sp/>new_comm_base(NULL,<sp/></highlight><highlight class="stringliteral">&quot;recv&quot;</highlight><highlight class="normal">,<sp/>_default_comm,<sp/>seri_copy);</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>new_default_address(res_comm[0][ncomm]);</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;client_response_header(%s):<sp/>could<sp/>not<sp/>create<sp/>response<sp/>comm&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>);</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/>head.<ref refid="structcomm__head__t_1a541f991a66b2422bec7b1cc25b5dd567" kindref="member">valid</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>head;</highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/>res_comm[0][ncomm]-&gt;<ref refid="structcomm__t_1a9c883133ed0ee04e11983dc7efbc8bfb" kindref="member">sent_eof</ref>[0]<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/>res_comm[0][ncomm]-&gt;<ref refid="structcomm__t_1a1d7418e5f54be56939a7f26b68a55f3d" kindref="member">recv_eof</ref>[0]<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/>inc_client_response_count(x);</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/>ncomm<sp/>=<sp/>get_client_response_count(x);</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;client_response_header(%s):<sp/>Created<sp/>response<sp/>comm<sp/>number<sp/>%d&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>ncomm);</highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Add<sp/>address<sp/>&amp;<sp/>request<sp/>ID<sp/>to<sp/>header</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/>strcpy(head.<ref refid="structcomm__head__t_1a5a1970e9fb2c1087c001345603ab5c2b" kindref="member">response_address</ref>,<sp/>res_comm[0][ncomm<sp/>-<sp/>1]-&gt;address);</highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/>sprintf(head.<ref refid="structcomm__head__t_1a80b9979899d06f21b7f996c1a119e665" kindref="member">request_id</ref>,<sp/></highlight><highlight class="stringliteral">&quot;%d&quot;</highlight><highlight class="normal">,<sp/>rand());</highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;client_response_header(%s):<sp/>response_address<sp/>=<sp/>%s,<sp/>request_id<sp/>=<sp/>%s&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>head.<ref refid="structcomm__head__t_1a5a1970e9fb2c1087c001345603ab5c2b" kindref="member">response_address</ref>,<sp/>head.<ref refid="structcomm__head__t_1a80b9979899d06f21b7f996c1a119e665" kindref="member">request_id</ref>);</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>head;</highlight></codeline>
<codeline lineno="226"><highlight class="normal">};</highlight></codeline>
<codeline lineno="227"><highlight class="normal"></highlight></codeline>
<codeline lineno="235"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="236"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>client_comm_send(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*data,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>len)<sp/>{</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;client_comm_send(%s):<sp/>%d<sp/>bytes&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>len);</highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref><sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;client_comm_send(%s):<sp/>no<sp/>request<sp/>comm<sp/>registered&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>);</highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*req_comm<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>*)(x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>);</highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>default_comm_send(*req_comm,<sp/>data,<sp/>len);</highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(is_eof(data))<sp/>{</highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/>req_comm-&gt;<ref refid="structcomm__t_1a9c883133ed0ee04e11983dc7efbc8bfb" kindref="member">sent_eof</ref>[0]<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="249"><highlight class="normal">};</highlight></codeline>
<codeline lineno="250"><highlight class="normal"></highlight></codeline>
<codeline lineno="262"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="263"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>client_comm_recv(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>**data,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>len,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>allow_realloc)<sp/>{</highlight></codeline>
<codeline lineno="264"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;client_comm_recv(%s)&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>);</highlight></codeline>
<codeline lineno="265"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((x.<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref><sp/>==<sp/>NULL)<sp/>||<sp/>(get_client_response_count(x)<sp/>==<sp/>0))<sp/>{</highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;client_comm_recv(%s):<sp/>no<sp/>response<sp/>comm<sp/>registered&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>);</highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>***res_comm<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>***)(x.<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref>);</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>default_comm_recv(res_comm[0][0][0],<sp/>data,<sp/>len,<sp/>allow_realloc);</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;client_comm_recv(%s):<sp/>default_comm_recv<sp/>returned<sp/>%d&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>ret);</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Close<sp/>response<sp/>comm<sp/>and<sp/>decrement<sp/>count<sp/>of<sp/>response<sp/>comms</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;client_comm_recv(%s):<sp/>default_comm_recv<sp/>returned<sp/>%d&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>ret);</highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/>free_default_comm(res_comm[0][0]);</highlight></codeline>
<codeline lineno="280"><highlight class="normal"><sp/><sp/>free_comm_base(res_comm[0][0]);</highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/>free(res_comm[0][0]);</highlight></codeline>
<codeline lineno="282"><highlight class="normal"><sp/><sp/>dec_client_response_count(x);</highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nresp<sp/>=<sp/>get_client_response_count(x);</highlight></codeline>
<codeline lineno="284"><highlight class="normal"><sp/><sp/>memmove(*res_comm,<sp/>*res_comm<sp/>+<sp/>1,<sp/>nresp*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structcomm__t" kindref="compound">comm_t</ref>*));</highlight></codeline>
<codeline lineno="285"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="286"><highlight class="normal">};</highlight></codeline>
<codeline lineno="287"><highlight class="normal"></highlight></codeline>
<codeline lineno="288"><highlight class="normal"></highlight></codeline>
<codeline lineno="289"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>__cplusplus<sp/></highlight><highlight class="comment">/*<sp/>If<sp/>this<sp/>is<sp/>a<sp/>C++<sp/>compiler,<sp/>end<sp/>C<sp/>linkage<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="290"><highlight class="normal">}</highlight></codeline>
<codeline lineno="291"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="292"><highlight class="normal"></highlight></codeline>
<codeline lineno="293"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*CISCLIENTCOMM_H_*/</highlight><highlight class="preprocessor"></highlight></codeline>
    </programlisting>
    <location file="/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h"/>
  </compounddef>
</doxygen>
