开发者

How to check the remaining buffer size of pipe in windows in c/c++?

开发者 https://www.devze.com 2023-01-15 14:14 出处:网络
BTW the remaining buffer will automatically increase if 开发者_Python百科the other side reads data out of it,right?How about PeekNamedPipe? It would seem that the following will return the total numbe

BTW the remaining buffer will automatically increase if 开发者_Python百科the other side reads data out of it,right?


How about PeekNamedPipe? It would seem that the following will return the total number of bytes remaining to be read from the pipe.

DWORD totalBytesAvailable;
BOOL WINAPI PeekNamedPipe(
  handle,                // __in       HANDLE hNamedPipe,
  NULL,                  // __out_opt  LPVOID lpBuffer,
  0,                     // __in       DWORD nBufferSize,
  NULL,                  // __out_opt  LPDWORD lpBytesRead,
  &totalBytesAvailable,  // __out_opt  LPDWORD lpTotalBytesAvail,
  NULL                   // __out_opt  LPDWORD lpBytesLeftThisMessage
);
0

精彩评论

暂无评论...
验证码 换一张
取 消