Hello to all the list,<div><br></div><div>I&#39;m new here and I need help using the C API of Spread for a project I&#39;m working on. Sadly even reading the manpages and the examples shipped with the source tarball I can&#39;t find what I&#39;m doing wrong.</div>
<div><br></div><div>I have this small application that send messages of a certain format to Spread (unrelated parts omitted):</div><div><div>    ret = SP_connect(&quot;4803@localhost&quot;, &quot;send&quot;, 0, 0, &amp;mbox, private_group);</div>
<div>    ret = SP_join(mbox, GROUPNAME);</div><div><div>    ret = SP_multicast( mbox, UNRELIABLE_MESS, GROUPNAME, 1, mess.byteSize(), mess.toString());</div><div>    ret = SP_multicast( mbox, SAFE_MESS, GROUPNAME , 1, mess.byteSize(), mess.toString());</div>
</div><div>    SP_disconnect(mbox);</div><div><br></div><div>And this other application that should wait for those messages:</div><div><div>    ret = SP_connect(&quot;4803@localhost&quot;, &quot;get&quot;, 0, 0, &amp;mbox, private_group);</div>
<div>    ret = SP_join(mbox, GROUPNAME);</div></div><div><br></div><div><div>    int ret, serviceType;</div><div>    short int messType;</div><div>    int endianness = 0;</div><div>    char sender[MAX_GROUP_NAME];</div><div>
    int max_groups = 1;</div><div>    int n_groups = 0;</div><div>    char groups[1][MAX_GROUP_NAME];</div><div>    </div><div>    char *msg = (char *)malloc(sizeof(char) * MAX_MESS_LEN);</div><div>    </div><div>    while (1) {</div>
<div>        serviceType = messType = 0;</div><div>        memset((void *)&amp;msg, 0, sizeof(char) * MAX_MESS_LEN);</div><div>        </div><div>        ret = SP_receive(mbox, &amp;serviceType, sender, max_groups, &amp;n_groups, groups, &amp;messType, &amp;endianness, MAX_MESS_LEN, msg);</div>
<div>        </div></div><div>        ...</div><div>   }</div><div><br></div><div>GROUPNAME has the same value in both applications.</div><div>Both applications are run on the same machine in which the Spread daemon is launched. When I send a message with the receiver app &quot;listening&quot;, SP_multicast succeeds but SP_receive immediately fails with SP_error: (-8) Connection closed by spread. Can you help me doing the correct thing?</div>
<div><br></div><div>Thanks to everyone,</div><div>Lisa Vitolo</div><div><br></div>-- <br>They say a little knowledge is a dangerous thing, but it&#39;s not one half so bad as a lot of ignorance.<br>
</div>