Example #1
0
			public virtual bool postFrame(SessionImpl s, Frame f)
			{
				// If we're in an error state
				log.debug("Dropping a frame because the Session state is " + "no longer active.");
				return false;
			}
Example #2
0
        internal static Frame parseHeader(SessionImpl session, byte[] headerBuffer, int length)
        {
            HeaderParser header = new HeaderParser(headerBuffer, length);

            core.MessageType msgType = MessageTypeStrings.GetMessageType(header.parseType());
            int channelNum = header.parseInt();
            int msgNum = header.parseInt();
            bool last = header.parseLast();
            long seqNum = header.parseUnsignedInt();
            int size = header.parseInt();

            int ansNum = - 1;
            if (header.hasMoreTokens())
            {
                ansNum = header.parseInt();
            }

            if (header.hasMoreTokens())
            {
                throw new BEEPException("Malformed BEEP Header");
            }

            return new Frame(msgType, session.getValidChannel(channelNum), msgNum, last, seqNum, size, ansNum);
        }
Example #3
0
			public virtual void  changeState(SessionImpl s, core.SessionState newState)
			{
				if (newState == core.SessionState.SESSION_STATE_ABORTED)
				{
					log.info("Error aborting, session already in a closed state.");
				}
				else if (newState == core.SessionState.SESSION_STATE_CLOSE_PENDING)
				{
					log.info("Error changing state to close pending, session already in a closed state.");
				}
				else
				{
					throw new BEEPException("Illegal session state transition (" + newState + ")");
				}
			}
Example #4
0
			public virtual void changeState(SessionImpl s, core.SessionState newState)
			{
				throw new BEEPException("Illegal session state transition");
			}
Example #5
0
			public virtual void changeState(SessionImpl s, core.SessionState newState)
			{
				if (!((newState == core.SessionState.SESSION_STATE_CLOSED) || (newState == core.SessionState.SESSION_STATE_ABORTED)))
				{
					throw new BEEPException("Illegal session state transition");
				}
				
				s.state = newState;
			}
Example #6
0
			public virtual bool postFrame(SessionImpl s, Frame f)
			{
				return ((ChannelImpl) f.Channel).postFrame(f);
			}
Example #7
0
			public virtual bool postFrame(SessionImpl s, Frame f)
			{
				// If we're in a PRE-GREETING state
				// only handle one frame at a time...
				// to avoid processing post-greeting
				// frames before the greeting has been
				// fully handled.
				lock (s)
				{
					return ((ChannelImpl) f.Channel).postFrame(f);
				}
			}
Example #8
0
			internal CloseReplyListener(SessionImpl enclosingInstance, ChannelImpl channel)
			{
				InitBlock(enclosingInstance);
				this.channel = channel;
				this.error = null;
			}
Example #9
0
			private void  InitBlock(SessionImpl enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
Example #10
0
			public GreetingListener(SessionImpl enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}
Example #11
0
			public ChannelZeroListener(SessionImpl enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}