PIPE_BUF_SIZE - How to reuse NamedPipe buffer
Posted on 2009-12-23
I am using NamedPipe in my MFC application. When the application is started, I create a NamedPipe. This NamedPipe is not closed until the application is closed. I set the PIPE_BUF_SIZE to 1024. I can only send/receive 11 messages, then the buffer is full, and the request can not be read any more. I increase the bufer to 65535 to allow more messages to be sent. I am wondering if there is a way to clear this buffer and reuse it without setting a limit. And, is there a way to find out if the buffer is about to be full. The NamedPipe is created as followed:
m_hInPipe = CreateNamedPipe(
PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,
Thanks for your help.