Solved

double messages in mailbox with Win32 API

Posted on 1997-08-13
1
205 Views
Last Modified: 2013-12-04
I don't understand why one of my task is receiving a message twice in its mailslot when the message is sent once.

I use VC++ 4.2 and NT 4.0.
0
Comment
Question by:didede
1 Comment
 
LVL 4

Accepted Solution

by:
davmarc earned 100 total points
ID: 1403846
It is a known problem - Microsoft considers it "by design".
This comes from KB article Q127905 "Messages Sent to Mailslot Are Duplicated":


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.


Davide Marcato.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question