I'm creating a server application that needs to broadcast a message to several clients. I figure that mailslots is the way to go, but how do I create them?
I can get a communication going between two mailslots, but it depends on the order I start the applications. If I start the server first, all the clients get the correct mailslot handle, but doesn't receive messages written to that mailslot. If I start the clients first they can't get the handle, since it's not created by the server.
If I use CreateMailSlot on both client and server machines and start the client first I can send messages from the server to the client.
I guess that what I'm asking is: Does anyone have some examples of how to create these mailslots. I think my problem is that I use wrong parameters in (such as FILE_FLAG_OVERLAPPED, etc) in WriteFile, CreateFile and CreateMailSlot...