c++ - Why does write() to pipe exit program when pipe writes to stdout? -


I have a server application that allows a popayan ("My Command", "W") file descriptor in a different thread Writes and if the command popen () passes the results to stdout or stderr in any output, my application exits. However, this is only a problem when my server application was implemented through inetd, if I have used ssh to launch the server, then there is no problem in it.

Similarly, when my server application reads from a popon ("MyCommand2", "r"), the file descriptor in a separate thread and if the result of the command pass () is stderr (stdin Moving on my pipe), then the application exits, then it only happens with inetd summoning, not summoning ssh.

You need to close all existing FDA processes before opening the pipe, then the I / O redirection thereof The reason is that if inetd, the process runs in the form of a daemon.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -