Mailslots Bug or Documentation Error?
I had to use some form of IPC (Inter Process Communications) on a recent project I was working on. Normally I am what you may call a sock-sexual (i.e. biased towards sockets) but this time for various reasons like security and service discovery. We had to use some other form of IPC. After some deliberation we decided to go with Mail slots. Mail slots are easy to use and provide a simple unreliable mechanism for message passing in a domain.
After a few hours of work we had the mechanism in place and started testing it. At first every thing seemed to work smooth and for a minute there I thought I would actually finish work early for a change. But unfortunately it turns out there is an interesting mail slot bug or documentation error on MSDN. The error is related to mail slot names.
When using a mail slot client to connect to a mail slot on the local machine the documentation says: “…To write to a mailslot on the local computer, a process can use a mailslot name that has the same form used for creating a mailslot…” The form they are referring to when it comes to a local computer is: \\.\mailslot\[path\]nameWhere the “.” denotes the local computer.
Well as it turns out (the hard way) the “.” Does not work when creating a client side connection on a mailslot using createfile API while the client is running inside a Terminal Services session. That is at the very least true on Windows 2003 server. We did not test it on Windows 2000 Server yet.
BTW, the solution to this problem is to query the local computer name and use its name instead of the “.” In the mail slot name for the client side of the mail slot.
-
Recent
- API Junkie is moving to APIJunkie.com
- How to use an external USB drive with a DVD player or breaking the FAT32-32GB limit.
- A fix for .Net 2.0 security update (KB922770) – error code: 0×669
- Debugging a .NET application on a production server using WinDbg
- Mailslots Bug or Documentation Error?
- Hello world!
-
Links
-
Archives
- November 2007 (1)
- September 2007 (1)
- July 2007 (1)
- June 2007 (1)
- February 2007 (1)
- January 2007 (1)
-
Categories
-
RSS
Entries RSS
Comments RSS