Questions conserning connection_client


    Aug 21 2006 | 11:38 pm
    I'm trying to set up a pair of externals that will be able to send and receive messages in the same way send/receive do. The sending object I have working fine, based on the typedmess function.
    I would like the receiving object to be able to "listen" to symbols that are shared with receive, so that messages sent by e.g. "send foo" are received both by "receive foo" and my object with proper "foo" argument. In order to achieve this I am attempting to use the connection_client function described in the SDK chapter 9.
    My first question is whether this will work at all, or if I have to find another approach to the problem?
    The second question conserns a compiling error in the traverse function. At the moment the struct of the external looks like this:
    typedef struct _receive{ // Data Structure for this object t_object ob; // REQUIRED: Our object void *obex; // REQUIRED: Object Extensions used by Jitter/Attribute stuff t_symbol *bus; // Bus that communication is passed along struct myclient *c_next; // Link pointer for connection_client void *outlet; // Need one for each outlet } t_receive;
    The traverse function is more or less a copy and paste of the sample method provided in the SDK:
    // Traversing the list of clients void *receive_traverse(t_receive *x, t_receive ***addr) { *addr = &x->c_next; return (x->c_next); }
    When attempting to build the object I get the following error at the line starting with *addr:
    error: cannot convert 'myclient**' to 't_receive**' in assignment
    The error message definitively makes sense, so I am wondering if there is a typo in the declaration of the traverse function in the SDK:
    void *myobject_traverse(t_myobject *x, t_myobject ***ptr);
    Should it instead be:
    void *myobject_traverse(t_myobject *x, myclient ***ptr);
    Any insight appreciated, Trond