I have defined a Pipe class in Java, making use of PipedReader and PipedWriter. I am now trying to port this same class to C#. Is it possible to accomplish the same as shown in the following code in C#?
public final class Pipe {
private final PipedReader pipedReader = new PipedReader();
private final PipedWriter pipedWriter = new PipedWriter();
public Pipe() {
pipedWriter.connect(pipedReader);
}
...
}
I am guessing what I’ll want to use in C# for PipedReader and PipedWriter will be StreamReader and StreamWriter?
Is there something like a connect() method?
Edit
So, my goal is to implement a (little) Pipe&Filter framework.
My idea would be to create a Pipe class and Filter classes, so that when I need to implement some system using a Pipe&Filter architecture style, I’ll code it against this little framework I am using.
Each filter would run on its own thread.
Thanks
I’m not sure if this is exactly what you are looking for, but there is a tutorial on using .Net pipes here. This will only work with .Net 3.5+.
EDIT:
There are examples on MSDN about using anonymous pipes. See this link.