acdvorak / named-pipe-wrapper

Wrapper library for Windows Named Pipes in C# / .NET 4.0 / VS 2010
MIT License
233 stars 178 forks source link

High CPU Usage #4

Open thaxy opened 9 years ago

thaxy commented 9 years ago

Hi,

I have a client in a WindowsService which does the following:

var client = new NamedPipeClient<string>("my-pipe");
client.Start();

The UI application acts as the server:

var server = new NamedPipeServer<string>("my-pipe");
server.ClientMessage += OnClientMessage;
server.Start();

Problem: If my UI application is closed the CPU Usage goes up to 100% on one core. I guess this is due a missing sleep where the client tries to connect to the server.

Greetings thaxy

Edit: This Issue was fixed with this https://github.com/reliablehosting/named-pipe-wrapper/commit/f7267a4ce0a76e25b7a9f5203d6e0d95dfd497cb commit in this pull request https://github.com/acdvorak/named-pipe-wrapper/pull/3 I hope that acdvorak will update this with his own code. His syntax and knowledge is awesome.

davidgrupp commented 9 years ago

@thaxy Maybe email @acdvorak about this issue since he has been mia on the project for so long. His email is in his profile.

thaxy commented 9 years ago

@davidgrupp thanks for the reply. But I guess @acdvorak already seen this issue and is too busy with other projects/work. I will let this Issue open, maybe he finds the time in the future.

davidgrupp commented 9 years ago

@thaxy well if you (or anyone else) needs the change it looks like https://github.com/reliablehosting/named-pipe-wrapper has the fix applied (they also created the PR). You can just clone that repo and compile from source to get a working build. Best of luck!

thaxy commented 9 years ago

You just confirmed what I wrote in my edited original post. But I'm fine with that if this makes it clearer.