| | | 1 | | using Renci.SshNet.Messages.Connection; |
| | | 2 | | |
| | | 3 | | namespace Renci.SshNet.Channels |
| | | 4 | | { |
| | | 5 | | internal abstract class ServerChannel : Channel |
| | | 6 | | { |
| | | 7 | | /// <summary> |
| | | 8 | | /// Initializes a new instance of the <see cref="ServerChannel"/> class. |
| | | 9 | | /// </summary> |
| | | 10 | | /// <param name="session">The session.</param> |
| | | 11 | | /// <param name="localChannelNumber">The local channel number.</param> |
| | | 12 | | /// <param name="localWindowSize">Size of the window.</param> |
| | | 13 | | /// <param name="localPacketSize">Size of the packet.</param> |
| | | 14 | | /// <param name="remoteChannelNumber">The remote channel number.</param> |
| | | 15 | | /// <param name="remoteWindowSize">The window size of the remote party.</param> |
| | | 16 | | /// <param name="remotePacketSize">The maximum size of a data packet that we can send to the remote party.</para |
| | | 17 | | protected ServerChannel(ISession session, |
| | | 18 | | uint localChannelNumber, |
| | | 19 | | uint localWindowSize, |
| | | 20 | | uint localPacketSize, |
| | | 21 | | uint remoteChannelNumber, |
| | | 22 | | uint remoteWindowSize, |
| | | 23 | | uint remotePacketSize) |
| | 17 | 24 | | : base(session, localChannelNumber, localWindowSize, localPacketSize) |
| | 17 | 25 | | { |
| | 17 | 26 | | InitializeRemoteInfo(remoteChannelNumber, remoteWindowSize, remotePacketSize); |
| | 17 | 27 | | } |
| | | 28 | | |
| | | 29 | | protected void SendMessage(ChannelOpenConfirmationMessage message) |
| | 17 | 30 | | { |
| | | 31 | | // No need to check whether channel is open when trying to open a channel |
| | 17 | 32 | | Session.SendMessage(message); |
| | | 33 | | |
| | | 34 | | // When we act as server, consider the channel open when we've sent the |
| | | 35 | | // confirmation message to the peer |
| | 17 | 36 | | IsOpen = true; |
| | 17 | 37 | | } |
| | | 38 | | } |
| | | 39 | | } |