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.
|
- using System.IO.Pipelines;
- using System.Threading.Tasks;
-
- namespace Shadowsocks.Protocol
- {
- class DuplexPipe : IDuplexPipe
- {
- public PipeReader Input { get; set; }
- public PipeWriter Output { get; set; }
-
- public static Task CopyDuplexPipe(IDuplexPipe p1, IDuplexPipe p2)
- {
- var t1 = p1.Input.CopyToAsync(p2.Output);
- var t2 = p2.Input.CopyToAsync(p1.Output);
-
- return Task.WhenAll(t1, t2);
- }
- }
- }
|