示例#1
0
        public static Protocol createStack(Protocol middle, out Protocol bot)
        {
            ProtocolSinkStack stack = new ProtocolSinkStack(null, null);

            middle.ProtocolSinkStack = stack;

            TOP    top    = new TOP("TOP");
            BOTTOM bottom = new BOTTOM();

            bot = bottom;
            top.DownProtocol    = middle;
            middle.DownProtocol = bottom;
            bottom.DownProtocol = null;

            top.UpProtocol    = null;
            middle.UpProtocol = top;
            bottom.UpProtocol = middle;

            bottom.startDownHandler();
            bottom.startUpHandler();
            middle.startDownHandler();
            middle.startUpHandler();
            top.startDownHandler();
            top.startUpHandler();


            top.start();
            middle.start();
            bottom.start();

            bottom.up(new Event(Event.SET_LOCAL_ADDRESS, localAddr));

            return(top);
        }
示例#2
0
        }         // StopListening

        // -=-=-=-=-=-=-=- Group Channel Methods -=-=-=-=-=-=-=-=-=-=-=-

        /// <summary>
        /// Sets up the ProtocolSinkStack
        /// </summary>
        private void SetupChannel()
        {
            prot_stack = new ProtocolSinkStack(this, props);
            prot_stack.ResponseChooser = responseChooser;
            prot_stack.setup();
        }         // SetupChannel