Board index » cppbuilder » Named Pipe... readable this time...

Named Pipe... readable this time...


2006-02-01 01:59:35 AM
cppbuilder43
Greetings all,
I'm trying to debug a recalcitrant C++Builder 6 app and had the
brainstorm of writing a separate pipe server task to receive/
log-to-file debug messages from it. Both programs would reside
on the same machine. I've tested the pipe server with a small
console based client app that successfully writes large amounts
of data, FAST. All appears fine on the server side. (The server
app is written in the "old-fashioned" WIN32 manner, as I'm that
kind of guy.)
I blithely thought that incorporating the client side into the
buggy app would be a snap, but... I can only perform a single
write into the pipe, using WriteFile(...) before it seems that I
never get another I/O event signalling that the write was
finished and the API is ready for another message.
Here's what the client send routine looks like...the setup of
the OVERLAPPED struct and creation of the event and existing
pipe file are done elsewhere. I tried to duplicate the logic of
the test client.
void TMyAppForm::WriteToPipe(char *pC)
{
unsigned long BytesWritten;
while(WaitForSingleObject(io.hEvent, 0) == WAIT_TIMEOUT)
Application->ProcessMessages();
ResetEvent(io.hEvent);
if(!WriteFile(hPipe, pC, strlen(pC), &BytesWritten, &io))
{
while(GetLastError() == ERROR_IO_PENDING)
Application->ProcessMessages();
}
}
Note that I'm a newbie to pipe IPC and am more familiar with M$
compiler environments.
Could the main message handler be "eating" my io events? I'm
stumped.
Thanks for any and all help,
Duane
 
 

Re:Named Pipe... readable this time...

Quote
Why did you repost this? I already replied to your other
posting.
Yeeeaaah... I noticed that.
Why? Because I failed to heed the instructions and had not
affixed a terminator to the end of each line of my remarks. This
resulted in a hideous post and thought there may be those who
would prefer to read something more legible.
That is all, and thank you.
 

Re:Named Pipe... readable this time...

"Duane A." < XXXX@XXXXX.COM >wrote in message
Quote
I'm trying to debug a recalcitrant C++Builder 6 app
<snip>
Why did you repost this? I already replied to your other posting.
Gambit
 

{smallsort}