IChannelDirectTcpip.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Net.Sockets;
  3. using Renci.SshNet.Common;
  4. namespace Renci.SshNet.Channels
  5. {
  6. /// <summary>
  7. /// A "direct-tcpip" SSH channel.
  8. /// </summary>
  9. internal interface IChannelDirectTcpip : IDisposable
  10. {
  11. /// <summary>
  12. /// Occurs when an exception is thrown while processing channel messages.
  13. /// </summary>
  14. event EventHandler<ExceptionEventArgs> Exception;
  15. /// <summary>
  16. /// Gets a value indicating whether this channel is open.
  17. /// </summary>
  18. /// <value>
  19. /// <c>true</c> if this channel is open; otherwise, <c>false</c>.
  20. /// </value>
  21. bool IsOpen { get; }
  22. /// <summary>
  23. /// Gets the local channel number.
  24. /// </summary>
  25. /// <value>
  26. /// The local channel number.
  27. /// </value>
  28. uint LocalChannelNumber { get; }
  29. /// <summary>
  30. /// Opens a channel for a locally forwarded TCP/IP port.
  31. /// </summary>
  32. /// <param name="remoteHost">The name of the remote host to forward to.</param>
  33. /// <param name="port">The port of the remote hosts to forward to.</param>
  34. /// <param name="forwardedPort">The forwarded port for which the channel is opened.</param>
  35. /// <param name="socket">The socket to receive requests from, and send responses from the remote host to.</param>
  36. void Open(string remoteHost, uint port, IForwardedPort forwardedPort, Socket socket);
  37. /// <summary>
  38. /// Binds the channel to the remote host.
  39. /// </summary>
  40. void Bind();
  41. /// <summary>
  42. /// Closes the channel.
  43. /// </summary>
  44. void Close();
  45. }
  46. }