PRB: Messages Sent to Mailslot Are Duplicated

Last reviewed: September 25, 1995
Article ID: Q127905
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT versions 3.5 and 3.51
        - Microsoft Windows 95 version 4.0
    

SYMPTOMS

One application creates a mailslot using CreateMailSlot() and reads from it using ReadFile(). A second application opens the mailslot using CreateFile() and writes to it using WriteFile(). The second application writes one message to the mailslot, but the first application receives three duplicates of the message.

CAUSE

This is expected behavior if you have three network transports loaded. There is no way to know which transport should be used to deliver to a given mailslot on a remote machine, so all transports are used.

RESOLUTION

Send a unique ID at the beginning of each message. The listening end can detect duplicates and delete them. If you have multiple clients sending messages, their messages may be interleaved in the mailslot. You may need to track which client sent which message last, in order to successfully detect duplicates.

STATUS

This behavior is by design.


Additional reference words: 3.50 4.00 95
KBCategory: kbprg kbprb
KBSubcategory: BseIpc


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: September 25, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.