natefinch / npipe

A Windows named pipe implementation written in pure Go.
MIT License
297 stars 73 forks source link

Correctly handle error_no_data #11

Closed aeckleder closed 9 years ago

aeckleder commented 10 years ago

When a client connects to a server and immediately disconnects, accept will return with an error_no_data, which is inconsistent with the behavior of other go Listeners. This patch will make Accept() ignore error_no_data, since there is nothing to do in that case anyway.

natefinch commented 10 years ago

Thanks for this. If you can put AcceptPipe back to exported, I can easily merge it.... but as-is, it'll need to go in a new branch, since it breaks the existing API. I do agree that AcceptPipe is not really useful and shouldn't be exposed (I was mimicking the net package's format, but it's extraneous in a single package, where Accept always calls AcceptPipe). I'll probably unexpose it when I merge in the other code for adding security attributes to dial and listen.

aeckleder commented 9 years ago

I made the acceptPipe() function public again, so you can merge this as is. It's fine if this goes private in one of the next versions.

natefinch commented 9 years ago

Great, thanks. I actually had intended to modify the commit and merge it, but never got around to it. Thanks for all your help. On Oct 1, 2014 8:03 AM, "Andreas Eckleder" notifications@github.com wrote:

I made the acceptPipe() function public again, so you can merge this as is. It's fine if this goes private in one of the next versions.

— Reply to this email directly or view it on GitHub https://github.com/natefinch/npipe/pull/11#issuecomment-57453431.