示例#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;
			}
示例#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);
        }
示例#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 + ")");
				}
			}
示例#4
0
			public virtual void changeState(SessionImpl s, core.SessionState newState)
			{
				throw new BEEPException("Illegal session state transition");
			}
示例#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;
			}
示例#6
0
			public virtual bool postFrame(SessionImpl s, Frame f)
			{
				return ((ChannelImpl) f.Channel).postFrame(f);
			}
示例#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);
				}
			}
示例#8
0
			internal CloseReplyListener(SessionImpl enclosingInstance, ChannelImpl channel)
			{
				InitBlock(enclosingInstance);
				this.channel = channel;
				this.error = null;
			}
示例#9
0
			private void  InitBlock(SessionImpl enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
示例#10
0
			public GreetingListener(SessionImpl enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}
示例#11
0
			public ChannelZeroListener(SessionImpl enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}