ChannelDirectTcpip.NET40.cs 726 B

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