< Summary

Information
Class: Renci.SshNet.Messages.Connection.ChannelOpenConfirmationMessage
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\ChannelOpenConfirmationMessage.cs
Line coverage
100%
Covered lines: 34
Uncovered lines: 0
Coverable lines: 34
Total lines: 97
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_RemoteChannelNumber()100%1100%
get_InitialWindowSize()100%1100%
get_MaximumPacketSize()100%1100%
get_BufferCapacity()100%1100%
.ctor()100%1100%
.ctor(...)100%1100%
LoadData()100%1100%
SaveData()100%1100%
Process(...)100%1100%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\ChannelOpenConfirmationMessage.cs

#LineLine coverage
 1namespace Renci.SshNet.Messages.Connection
 2{
 3    /// <summary>
 4    /// Represents SSH_MSG_CHANNEL_OPEN_CONFIRMATION message.
 5    /// </summary>
 6    [Message("SSH_MSG_CHANNEL_OPEN_CONFIRMATION", 91)]
 7    public class ChannelOpenConfirmationMessage : ChannelMessage
 8    {
 9        /// <summary>
 10        /// Gets the remote channel number.
 11        /// </summary>
 391612        public uint RemoteChannelNumber { get; private set; }
 13
 14        /// <summary>
 15        /// Gets the initial size of the window.
 16        /// </summary>
 17        /// <value>
 18        /// The initial size of the window.
 19        /// </value>
 391620        public uint InitialWindowSize { get; private set; }
 21
 22        /// <summary>
 23        /// Gets the maximum size of the packet.
 24        /// </summary>
 25        /// <value>
 26        /// The maximum size of the packet.
 27        /// </value>
 391628        public uint MaximumPacketSize { get; private set; }
 29
 30        /// <summary>
 31        /// Gets the size of the message in bytes.
 32        /// </summary>
 33        /// <value>
 34        /// The size of the messages in bytes.
 35        /// </value>
 36        protected override int BufferCapacity
 37        {
 38            get
 239            {
 240                var capacity = base.BufferCapacity;
 241                capacity += 4; // RemoteChannelNumber
 242                capacity += 4; // InitialWindowSize
 243                capacity += 4; // MaximumPacketSize
 244                return capacity;
 245            }
 46        }
 47
 48        /// <summary>
 49        /// Initializes a new instance of the <see cref="ChannelOpenConfirmationMessage"/> class.
 50        /// </summary>
 170751        public ChannelOpenConfirmationMessage()
 170752        {
 170753        }
 54
 55        /// <summary>
 56        /// Initializes a new instance of the <see cref="ChannelOpenConfirmationMessage"/> class.
 57        /// </summary>
 58        /// <param name="localChannelNumber">The local channel number.</param>
 59        /// <param name="initialWindowSize">Initial size of the window.</param>
 60        /// <param name="maximumPacketSize">Maximum size of the packet.</param>
 61        /// <param name="remoteChannelNumber">The remote channel number.</param>
 62        public ChannelOpenConfirmationMessage(uint localChannelNumber, uint initialWindowSize, uint maximumPacketSize, u
 25163            : base(localChannelNumber)
 25164        {
 25165            InitialWindowSize = initialWindowSize;
 25166            MaximumPacketSize = maximumPacketSize;
 25167            RemoteChannelNumber = remoteChannelNumber;
 25168        }
 69
 70        /// <summary>
 71        /// Called when type specific data need to be loaded.
 72        /// </summary>
 73        protected override void LoadData()
 170774        {
 170775            base.LoadData();
 170776            RemoteChannelNumber = ReadUInt32();
 170777            InitialWindowSize = ReadUInt32();
 170778            MaximumPacketSize = ReadUInt32();
 170779        }
 80
 81        /// <summary>
 82        /// Called when type specific data need to be saved.
 83        /// </summary>
 84        protected override void SaveData()
 285        {
 286            base.SaveData();
 287            Write(RemoteChannelNumber);
 288            Write(InitialWindowSize);
 289            Write(MaximumPacketSize);
 290        }
 91
 92        internal override void Process(Session session)
 170793        {
 170794            session.OnChannelOpenConfirmationReceived(this);
 170795        }
 96    }
 97}