Refactor client codes to use similar, standardized API

This commit is contained in:
Kristóf Tóth
2019-04-11 18:30:25 +02:00
parent 74e08fd052
commit d28e90862d
16 changed files with 226 additions and 161 deletions

View File

@ -7,8 +7,8 @@ class Program
{
using (var t = new PipeIO("in", "out"))
{
t.reader.OnMessage += (String msg) => t.writer.SendMessage(msg);
t.reader.Run();
t.Reader.OnMessage += (String msg) => t.Writer.SendMessage(msg);
t.Reader.Run();
}
}
}

View File

@ -65,19 +65,19 @@ namespace Pipe.IO
public class PipeIO : IDisposable
{
public PipeReader reader;
public PipeWriter writer;
public PipeReader Reader;
public PipeWriter Writer;
public PipeIO(String in_pipe_path, String out_pipe_path)
{
this.reader = new PipeReader(in_pipe_path);
this.writer = new PipeWriter(out_pipe_path);
this.Reader = new PipeReader(in_pipe_path);
this.Writer = new PipeWriter(out_pipe_path);
}
public void Dispose()
{
this.reader.Dispose();
this.writer.Dispose();
this.Reader.Dispose();
this.Writer.Dispose();
}
}
}