🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Named pipe WriteFile problem

#3145
From: Remy Lebeau (TeamB)
Date: Fri, 18 Aug 2006 17:42
32 lines
2056 bytes
"T. Meyer" <timon@mustek.de> wrote in message
news:44e5b421$1@newsgroups.borland.com...



> if I look on the pipe server I see that the whole buffer was send (HELLO)
> even if I set nNumberOfBytesToWrite to 1.
>
> I do further checkings after I use WriteFile(...). So I check if the no of
> bytes written equals the length of word to send (here HELLO = 5 bytes to
> send).
> If not I repeat calling WriteFile(...) until they are equal.

There is your problem them.  You are actually writing all 5 bytes to the
pipe, just individually.

> But on my server I get now five times the whole word HELLO instead
> of H, E, L, L, O, even if I send only one byte each time

On the server side, the bytes are going to cumulate in the pipe's buffer
until the server code actually reads from it.  Since you did not show any of
your server code yet, I can only assume that the code is reading the entire
buffer because you are specifying a size larger than 1 in your calls to
ReadFile().  Please show the actual server code.

> Seems that the WriteFile function doesnt see that I set bytesToSend to 1?

Yes, it does.


Gambit
Technical Details
Message-ID: <44e5fc56$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.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: <44e5b421$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,dd77ae57da4f6d50
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <44e5b421$1@newsgroups.borland.com>
Subject: Re: Named pipe WriteFile problem
Date: Fri, 18 Aug 2006 10:42:42 -0700
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <44e5fc56$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1155923030 68.69.17.41 (18 Aug 2006 10:43:50 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.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