Error Pipe Not Connected 233 (0xE9): How to Fix it

Adjusting your code is the only way to fix this issue

Reading time icon 2 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

ERROR_PIPE_NOT_CONNECTED

ERROR_PIPE_NOT_CONNECTED is a developer error, and it’s often followed by 233 (0xE9) No process is on the other end of the pipe message. If you ever encounter it, this guide will show you a few ways to fix it.

How can I fix ERROR_PIPE_NOT_CONNECTED?

1. Adjust your code

  1. Open your code.
  2. Ensure that there’s PIPE_NOWAIT available in your code.
  3. Use it like this:
    DWORD mode = PIPE_NOWAIT;
    SetNamedPipeHandleState(_callstackPipe,&mode,NULL,NULL);
    ConnectNamedPipe(_callstackPipe,NULL);
    mode = PIPE_WAIT;
    SetNamedPipeHandleState(_callstackPipe,&mode,NULL,NULL);

    pipe_nowait
  4. Save changes.

2. Use ConnectNamePipe

  1. Analyze your code.
  2. If you ever get ERROR_PIPE_NOT_CONNECTED in ReadFile it means that the remote end call has disconnected.
  3. If that’s the case, you can use ConnectNamedPipe without DisconnectNamedPipe.

3. Use listener thread after ConnectNamedPipe()

  1. Open your code.
  2. Adjust it so that you’re using a listener thread to wait for the next client like this:
    Main Thread
    {
        CreateListenerThread();
        WaitForQuitEvent();
    }
    ListenerThread
    {
        ConnectNamedPipe();
        if (no error)
        {
            CreateListenerThread();
            if( PeekNamedPipe() has a message )
            {
                ReadFile();
                ProcessReceivedMessage(); // if -quit signal quit event
            }
            FileFlushBuffers();
            DisconnectNamedPipe();
            CloseHandle();
        }
        else
        {
            // handle/report error
        }
    }

    listener thread
  3. Save changes.

4. Enable inheritance

  1. Open your code.
  2. Add the following line: BOOL res = SetHandleInformation(hPipe, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
  3. Save changes.

This will enable inheritance and hopefully fix the problem.

As mentioned before ERROR_PIPE_NOT_CONNECTED is a developer error, and to fix it, you need to tweak your code accordingly.

This is just one of many pipe errors you can encounter, and we wrote already about Error_Pipe_Busy and Error_Pipe_Local in our previous guides, so don’t miss them.

More about the topics: error

User forum

0 messages