You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

PipePair.cs 819 B

123456789101112131415161718192021222324252627282930313233
  1. using System.IO.Pipelines;
  2. namespace Shadowsocks.Protocol
  3. {
  4. internal class PipePair
  5. {
  6. /*
  7. *
  8. * --> c ---w[ uplink ]r--> s
  9. * <-- c <--r[ downlink ]w--- s
  10. * down up down
  11. */
  12. private readonly Pipe uplink = new Pipe();
  13. private readonly Pipe downlink = new Pipe();
  14. public DuplexPipe UpSide { get; private set; }
  15. public DuplexPipe DownSide { get; private set; }
  16. public PipePair()
  17. {
  18. UpSide = new DuplexPipe
  19. {
  20. Input = downlink.Reader,
  21. Output = uplink.Writer,
  22. };
  23. DownSide = new DuplexPipe
  24. {
  25. Input = uplink.Reader,
  26. Output = downlink.Writer,
  27. };
  28. }
  29. }
  30. }