named-pipe-wrapper icon indicating copy to clipboard operation
named-pipe-wrapper copied to clipboard

High CPU Usage

Open thaxy opened this issue 9 years ago • 4 comments

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.

thaxy avatar May 12 '15 10:05 thaxy

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

davidgrupp avatar May 19 '15 16:05 davidgrupp

@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.

thaxy avatar May 20 '15 07:05 thaxy

@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!

davidgrupp avatar May 20 '15 16:05 davidgrupp

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

thaxy avatar May 21 '15 09:05 thaxy