Unexpected connection exception
I am using Ice 3.5.1 for C++, for Linux.
I have a problem in the implementaion of an operation in a server. When a client invokes that operation, the first invocation works well, but in the second one the client prints over the standard output:
warning: connection exception: TransceiverI.cpp:721: Ice::ConnectionLostException: connection lost: recv() returned zero
The log file in the server contains the following lines:
error: unexpected connection exception: stc/Ice/Network.cpp:1057: Ice::SocketException: socket exception: Bad file descriptor
After reviewing the source code of the server operation, I have realized that it closes the file descriptor 0 by mistake, by calling:
If I remove that sentence, the problem above disappears.
My concern is now about understanding why this happens. As far as I Know, file descriptor 0 corresponds to the standard input. Thus, why is the connection exception thrown when the server closes file descriptor 0?