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

DuplexPipeMockup.cs 577 B

6 years ago
5 years ago
6 years ago
5 years ago
6 years ago
5 years ago
6 years ago
123456789101112131415161718192021222324
  1. using System.IO.Pipelines;
  2. namespace MQTTnet.AspNetCore.Tests.Mockups
  3. {
  4. public class DuplexPipeMockup : IDuplexPipe
  5. {
  6. public DuplexPipeMockup()
  7. {
  8. var pool = new LimitedMemoryPool();
  9. var pipeOptions = new PipeOptions(pool);
  10. Receive = new Pipe(pipeOptions);
  11. Send = new Pipe(pipeOptions);
  12. }
  13. PipeReader IDuplexPipe.Input => Receive.Reader;
  14. PipeWriter IDuplexPipe.Output => Send.Writer;
  15. public Pipe Receive { get; set; }
  16. public Pipe Send { get; set; }
  17. }
  18. }