Sorry, but don't know if it is too late. This thread seems to be quite old.
But just for the benefits of those who are like me who Google this problem here.
The problem the thread starter faced is simple, THE CLIENT CANNOT RECONNECT TO THE SAME PIPE AFTER IT IS DISCONNECTED!
So in the event that the pipe on the client side is suddenly closed, the pipe on the server side is dead as well. If you want to reconnect, the server needs to provide another CreateNamedPipe function to get the new connection and ask the client to try it.
The key is the understanding of pipes.