You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To reproduce, add the following lines to the Program class in DemoHost (just a place to quickly add this in the current codebase)
var myLogger = new Logger(logLevel: LogLevel.Debug, logDirectory: "C:/", messageBufferSize: 0);
const string pipeName = "myPipe";
var host = new NpHost(pipeName, myLogger);
host.AddService<IIPCBridge>(bridge);
host.Open();
host.Close();
The logfile will show the following error lines:
2023-09-27T15:22:10.003 Error Error in ProcessRequest: System.IO.EndOfStreamException: Unable to read beyond the end of the stream.:: at System.IO.BinaryReader.InternalRead(Int32 numBytes):: at System.IO.BinaryReader.ReadInt32():: at ServiceWire.Host.ProcessRequest(Stream readStream, Stream writeStream) in *\src\ServiceWire\Host.cs:line 277
2023-09-27T15:22:10.048 Error ProcessClientThread error: System.IO.IOException: Pipe is broken.:: at System.IO.Pipes.PipeStream.CheckWriteOperations():: at System.IO.Pipes.PipeStream.Flush():: at System.IO.BufferedStream.Flush():: at System.IO.BufferedStream.Dispose(Boolean disposing):: at System.IO.Stream.Close():: at System.IO.BinaryReader.Dispose(Boolean disposing):: at System.IO.BinaryReader.Close():: at ServiceWire.Host.ProcessRequest(Stream readStream, Stream writeStream) in *\src\ServiceWire\Host.cs:line 317:: at ServiceWire.Host.ProcessRequest(Stream stream) in *\src\ServiceWire\Host.cs:line 252:: at ServiceWire.NamedPipes.NpHost.ClientConnectionMade(Object sender, PipeClientConnectionEventArgs args) in *\src\ServiceWire\NamedPipes\NpHost.cs:line 69:: at ServiceWire.NamedPipes.NpListener.ProcessClientThread(NamedPipeServerStream pipeStream) in *\src\ServiceWire\NamedPipes\NpListener.cs:line 85
When stopping the NpListener it makes a client.Connect call. See NpListener.cs, line 47
//make fake connection to terminate the waiting stream
try
{
using (var client = new NamedPipeClientStream(PipeName))
{
client.Connect(50);
}
}
Which in turn raises the ClientConnectionMade event in NpHost, which then tries to do
var stream = new BufferedStream(args.PipeStream);
base.ProcessRequest(stream);
On a pipe that is already closing (or closed already).
So far my quick investigation of the issue.
Not really critical, but closing should be smooth process without error messages in the log file I assume.
The text was updated successfully, but these errors were encountered:
To reproduce, add the following lines to the Program class in DemoHost (just a place to quickly add this in the current codebase)
The logfile will show the following error lines:
When stopping the NpListener it makes a client.Connect call. See NpListener.cs, line 47
Which in turn raises the ClientConnectionMade event in NpHost, which then tries to do
On a pipe that is already closing (or closed already).
So far my quick investigation of the issue.
Not really critical, but closing should be smooth process without error messages in the log file I assume.
The text was updated successfully, but these errors were encountered: