PRB: TransactNamedPipe() Returns Error 230

Last reviewed: November 29, 1995
Article ID: Q140022
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) versions 3.5, 3.51

SYMPTOMS

When you use Named Pipes and run the client and server on the same computer, if TransactNamedPipe() is called from the client side, the error code returned is 230 (the pipe state is invalid).

CAUSE

The client side is running in byte mode as opposed to message mode as required by TransactNamedPipe().

RESOLUTION

Use SetNamedPipeHandleState() to set the pipe mode to message mode on the client side.

STATUS

This behavior is by design.

MORE INFORMATION

If the client and server are running on the same computer, it is possible to open the client side without explicitly specifying the computer name using this format:

   \\.\pipe\test

This is processed by the Named Pipe File System (NPFS), which defaults to byte mode. For this reason, if SetNamedPipeClientHandle() is not called on the client side, calling TransactNamedPipe() will fail with the error 230.

Instead of using the previous format, a client application running on the same computer (or on a different computer) can use the computer name as shown here:

   \\Server\pipe\test

When the computer name is used like this, the request is processed through the redirector, which defaults to message mode. Therefore, a call to SetNamedPipeHandleState() is not required.

Please note that a robust application should call SetNamedPipeHandleState() even if the client is running on a different computer or using the computer name if running on the same computer.


Additional reference words: 3.50 3.51
KBCategory: kbnetwork kbdocerr kbprb
KBSubcategory: NtwkMisc


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.