ChannelDirectTcpip.NET35.cs 694 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Net.Sockets;
  3. using System.Threading;
  4. namespace Renci.SshNet.Channels
  5. {
  6. /// <summary>
  7. /// Implements "direct-tcpip" SSH channel.
  8. /// </summary>
  9. internal partial class ChannelDirectTcpip
  10. {
  11. partial void ExecuteThread(Action action)
  12. {
  13. ThreadPool.QueueUserWorkItem((o) => { action(); });
  14. }
  15. partial void InternalSocketReceive(byte[] buffer, ref int read)
  16. {
  17. read = this._socket.Receive(buffer);
  18. }
  19. partial void InternalSocketSend(byte[] data)
  20. {
  21. this._socket.Send(data, 0, data.Length, SocketFlags.None);
  22. }
  23. }
  24. }