//
        // Write the booleans that this object uses to a BooleanStream
        //
        public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs)
        {
            KeepAliveInfo info = (KeepAliveInfo)o;

            int rc = base.TightMarshal1(wireFormat, info, bs);

            return(rc + 0);
        }
예제 #2
0
        protected virtual void WriteKeepAliveInfo(KeepAliveInfo command, BinaryWriter dataOut)
        {
            StompFrame frame = new StompFrame(StompFrame.KEEPALIVE);

            if (Tracer.IsDebugEnabled)
            {
                Tracer.Debug("StompWireFormat - Writing " + frame.ToString());
            }

            frame.ToStream(dataOut);
        }
예제 #3
0
            public bool Iterate()
            {
                if (this.pending.CompareAndSet(true, false) && this.parent.monitorStarted.Value)
                {
                    try
                    {
                        KeepAliveInfo info = new KeepAliveInfo();
                        this.parent.next.Oneway(info);
                    }
                    catch (IOException e)
                    {
                        this.parent.OnException(parent, e);
                    }
                }

                return(this.pending.Value);
            }
예제 #4
0
 protected void OnKeepAliveCommand(ITransport commandTransport, KeepAliveInfo info)
 {
     try
     {
         if (connected.Value)
         {
             info.ResponseRequired = false;
             transport.Oneway(info);
         }
     }
     catch (Exception ex)
     {
         if (!closing.Value && !closed.Value)
         {
             OnException(ex);
         }
     }
 }
예제 #5
0
 protected override void OnCommand(ITransport sender, Command command)
 {
     commandReceived.Value = true;
     inRead.Value          = true;
     try
     {
         if (command.IsKeepAliveInfo)
         {
             KeepAliveInfo info = command as KeepAliveInfo;
             if (info.ResponseRequired)
             {
                 try
                 {
                     info.ResponseRequired = false;
                     Oneway(info);
                 }
                 catch (IOException ex)
                 {
                     OnException(this, ex);
                 }
             }
         }
         else if (command.IsWireFormatInfo)
         {
             lock (monitor)
             {
                 remoteWireFormatInfo = command as WireFormatInfo;
                 try
                 {
                     StartMonitorThreads();
                 }
                 catch (IOException ex)
                 {
                     OnException(this, ex);
                 }
             }
         }
         base.OnCommand(sender, command);
     }
     finally
     {
         inRead.Value = false;
     }
 }
예제 #6
0
            public Boolean Iterate()
            {
                if (!_pending.CompareAndSet(true, false) || !_parent._monitorStarted.Value)
                {
                    return(_pending.Value);
                }

                try
                {
                    var info = new KeepAliveInfo();
                    _parent.Next.Oneway(info);
                }
                catch (IoException ex)
                {
                    _parent.OnException(_parent, ex);
                }

                return(_pending.Value);
            }
예제 #7
0
            public bool Iterate()
            {
                Tracer.Debug("AsyncWriteTask perparing for another Write Check");
                if (this.parent.monitorStarted.Value)
                {
                    try
                    {
                        Tracer.Debug("AsyncWriteTask Write Check required sending KeepAlive.");
                        KeepAliveInfo info = new KeepAliveInfo();
                        this.parent.Oneway(info);
                    }
                    catch (IOException e)
                    {
                        this.parent.OnException(parent, e);
                    }
                }

                return(false);
            }
예제 #8
0
 protected void OnKeepAliveCommand(ITransport commandTransport, KeepAliveInfo info)
 {
     Tracer.Info("Keep alive message received.");
     if (info.ResponseRequired)
     {
         try
         {
             info.ResponseRequired = false;
             OneWay(info);
         }
         catch (Exception ex)
         {
             if (!closing && !closed)
             {
                 OnException(commandTransport, ex);
             }
         }
     }
 }
예제 #9
0
            public bool Iterate()
            {
                Tracer.DebugFormat("InactivityMonitor[{0}] perparing for another Write Check", parent.instanceId);
                if (this.pending.CompareAndSet(true, false) && this.parent.monitorStarted.Value)
                {
                    try
                    {
                        Tracer.DebugFormat("InactivityMonitor[{0}] Write Check required sending KeepAlive.",
                                           parent.instanceId);
                        KeepAliveInfo info = new KeepAliveInfo();
                        this.parent.next.Oneway(info);
                    }
                    catch (IOException e)
                    {
                        this.parent.OnException(parent, e);
                    }
                }

                return(this.pending.Value);
            }
예제 #10
0
        protected void OnKeepAliveCommand(ITransport commandTransport, KeepAliveInfo info)
        {
            Tracer.Debug("Keep alive message received.");

            try
            {
                if (connected.Value)
                {
                    Tracer.Debug("Returning KeepAliveInfo Response.");
                    info.ResponseRequired = false;
                    transport.Oneway(info);
                }
            }
            catch (Exception ex)
            {
                if (!closing.Value && !closed.Value)
                {
                    OnException(ex);
                }
            }
        }
예제 #11
0
        protected virtual void WriteKeepAliveInfo(KeepAliveInfo command, BinaryWriter dataOut)
        {
            var frame = new StompFrame(StompFrame.Keepalive, _encodeHeaders);

            frame.ToStream(dataOut);
        }
예제 #12
0
 protected virtual void WriteKeepAliveInfo(KeepAliveInfo command, BinaryWriter dataOut)
 {
     dataOut.Write((byte)'\n');
 }
 public virtual Response processKeepAliveInfo(KeepAliveInfo info)
 {
     return(null);
 }