Named pipe is closing on its own after reading one message
I am trying to run a named pipe server on a windows service for an ASP.net web API to communicate with. I have got the ASP.net to be able to send a message but immediately after reading from the pipe it closes, not just the client server connection, the named pipe service simply disposes itself. When I try to call write after reading to send returned data I get error “Cannot access a closed pipe.” same error occurs when trying to call WaitForConnection(). I am not sure what is causing this and why it occurs. The Windows Service stays running so that isn’t an issue.