Мне нужен анонимный канал внутри одного и того же процесса, чтобы обеспечить потоковую асинхронную связь между двумя библиотеками.
Все работает, пока я не вызову Stream.Read () - я получаю исключение UnauthorizedAccessException - Доступ к пути запрещен. Есть идеи?
using (var pipeServer = new AnonymousPipeServerStream(PipeDirection.Out))
using (var pipeClient = new AnonymousPipeClientStream(PipeDirection.In, pipeServer.SafePipeHandle))
{
// External lib should close server pipe when it's done
archFile.ExtractionFinished += (sender, args) => pipeServer.Close();
archFile.BeginExtractFile(archFileName, pipeServer);
var buf = new byte[1000];
int read;
while ((read = pipeClient.Read(buf, 0, buf.Length)) > 0)
{ ... }
}