Wait for clients to read from the pipe before disconnecting the server.
Found while testing.
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
/* Disconnect the named pipe in case it was created from a passive stream.
*/
if (s->server) {
+ /* Flush the pipe to allow the client to read the pipe's contents
+ * before disconnecting. */
+ FlushFileBuffers(s->fd);
DisconnectNamedPipe(s->fd);
}
CloseHandle(s->fd);