+ /* set remote socket instance */
+ SCPY(remote_name, msg->param.hello.application);
+ return(0);
+ }
+
+ /* check we have no application name */
+ if (remote_name[0])
+ {
+ PERROR("Remote application did not send us a hello message.\n");
+ return(-1);
+ }
+
+ /* new join */
+ if (msg->type == MESSAGE_NEWREF)
+ {
+ /* create new join instance */
+ join = new JoinRemote(0, remote_name, sock_id); // must have no serial, because no endpoint is connected
+ if (!join)
+ FATAL("No memory for remote join instance\n");
+ return(0);
+ }
+
+ /* bchannel message
+ * no ref given for *_ack */
+ if (msg->type == MESSAGE_BCHANNEL)
+ if (msg->param.bchannel.type == BCHANNEL_ASSIGN_ACK
+ || msg->param.bchannel.type == BCHANNEL_REMOVE_ACK)
+ {
+ /* no ref, but address */
+ message_bchannel_from_join(NULL, msg->param.bchannel.type, msg->param.bchannel.addr);
+ return(0);
+ }
+
+ /* check for ref */
+ if (!msg->ref)
+ {
+ PERROR("Remote application did not send us a valid ref with a message.\n");
+ return(-1);