🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10560

Re: Mailslot stutters

#10560
From: Gary Setter
Date: Mon, 05 Apr 2004 13:22
40 lines
2279 bytes
"Eugene Mayevski [SecureBlackbox]" <mayevski@eldos.org> wrote in message
news:4070f5b0@newsgroups.borland.com...
> Gary Setter wrote:
>
> > I'm trying to understand mailslots by playing with the MSDN sample.
> > What I'm seeing is for ever WriteFile that the client does,
GetMailslotInfo
> > indicates that two messages are ready to read.
>
> This is how mailslots work. They will send the message using each
> installed network protocol, for example TCP/IP and IPX. So each sent
> message will arrive anywhere between 0 and 2 times.
>
<snip>
For what it's worth, I found that if I change how I open the mailslot for
writes, I can send just the one message.

I changed this line in the client:

hFile = CreateFile("\\\\*\\mailslot\\sample_mailslot",
   GENERIC_WRITE,
   FILE_SHARE_READ,  // required to write to a mailslot
   (LPSECURITY_ATTRIBUTES) NULL,
   OPEN_EXISTING,
   FILE_ATTRIBUTE_NORMAL,
   (HANDLE) NULL);

to

hFile = CreateFile("\\\\.\\mailslot\\sample_mailslot",
   GENERIC_WRITE,
   FILE_SHARE_READ,  // required to write to a mailslot
   (LPSECURITY_ATTRIBUTES) NULL,
   OPEN_EXISTING,
   FILE_ATTRIBUTE_NORMAL,
   (HANDLE) NULL);

Thanks for the tip Eugene!
Gary
Technical Details
Message-ID: <40715d81@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4070af2f@newsgroups.borland.com> <4070f5b0@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,46bec353392a3907
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-04-05 06:40:11 PST
From: "Gary Setter" <setterg@worldnet.att.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4070af2f@newsgroups.borland.com> <4070f5b0@newsgroups.borland.com>
Subject: Re: Mailslot stutters
Date: Mon, 5 Apr 2004 08:22:15 -0500
Lines: 41
MIME-Version: 1.0
Content-Type: text/plain;
 charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 12.74.20.40
Message-ID: <40715d81@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1081171329 12.74.20.40 (5 Apr 2004 06:22:09 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail