Example #1
0
        /**************************************************************/
        private Message RecvView(Member m)
        {
            View view = new View();
            Message msg = new Message();

            view.nmembers = ReadInt ();
            view.version = ReadString (ENS_VERSION_MAX_SIZE);
            view.group = ReadString(ENS_GROUP_NAME_MAX_SIZE);
            view.proto = ReadString(ENS_PROTOCOL_MAX_SIZE);
            view.ltime = ReadInt ();
            view.primary = ReadBool ();
            view.parameters=ReadString (ENS_PARAMS_MAX_SIZE);
            view.address = ReadAddrArray ();
            view.view = ReadEndptArray ();
            view.endpt = ReadEndpt ();
            view.addr= ReadString(ENS_ADDR_MAX_SIZE);
            view.rank = ReadInt ();
            view.name = ReadString(ENS_NAME_MAX_SIZE);
            view.view_id = ReadViewId();

            // The group is unblocked now.
            m.current_status=Member.Status.Normal;
            m.current_view = view;

            msg.mtype = UpType.VIEW;
            msg.view = view;
            return msg;
        }
Example #2
0
        private Message RecvExit(Member m)
        {
            Message msg = new Message ();

            if (!(Member.Status.Leaving == m.current_status))
                throw new EnsembleException("CbExit: mbr state is not leaving");

            msg.mtype = UpType.EXIT;

            /* Remove the context from the hashtable, we shall no longer deliver
             * messages to it
             */
            ContextRemove(m);

            // Tell members that this member is no longer valid
            m.current_status = Member.Status.Left;

            return msg;
        }
Example #3
0
        private Message RecvSend(Member m)
        {
            int origin ;
            byte[] data;
            Message msg = new Message ();

            origin = ReadInt();
            data = ReadData();

            //    assert(origin < s->nmembers) ;
            msg.mtype= UpType.SEND;
            msg.origin = origin;
            msg.data = data;
            return msg;
        }
Example #4
0
 private Message RecvBlock(Member m)
 {
     Message msg = new Message ();
     msg.mtype = UpType.BLOCK;
     return msg;
 }