Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectNamedPipe fails #10

Closed
svenbw opened this issue Jun 8, 2011 · 8 comments
Closed

ConnectNamedPipe fails #10

svenbw opened this issue Jun 8, 2011 · 8 comments
Labels

Comments

@svenbw
Copy link

svenbw commented Jun 8, 2011

Sometimes this function fails although there is a pipe created.
It seems that the CreateNamedPipe function can report that the connection is complete when it's not ready yet.

Changing the code by checking on the 535 (ERROR_PIPE_CONNECTED) seems to overcome this issue.

//failed to connect client pipe
if ((success != 1) && (Marshal.GetLastWin32Error() != 535))
{
    break;
}
@synhershko
Copy link
Owner

I'll take a look at that in a few days, thanks

synhershko added a commit that referenced this issue Jun 11, 2011
@synhershko
Copy link
Owner

Checking for an error like you suggested doesn't seem to be the right way to do this. Can you please check the latest version where I made a small correction?

@synhershko
Copy link
Owner

I'm assuming this issue is fixed, then

@pherrera
Copy link

The comment by svenbw is right, you need to do that change because ERROR_PIPE_CONNECTED can be returned as an "error" in some scenarios, you're currently just assuming it's not connected when it is.

@synhershko
Copy link
Owner

I've refactored this code (locally, haven't pushed yet), will take another look at this soon

@synhershko synhershko reopened this Oct 25, 2012
@robinwassen
Copy link
Collaborator

@synhershko You have fixed this, so I think you can close it:

internal static void ConnectPipe(object stateObject)

@robinwassen
Copy link
Collaborator

Nevermind, might need to be fixed here too:

using (state.clientPipeHandle = CreateNamedPipe(

@robinwassen
Copy link
Collaborator

Closing as duplicate of #54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants