14 #include <sys/types.h> 17 #include <sys/socket.h> 40 m_parentSocket(parentSocket),
41 m_parentPipe(parentPipe),
44 m_numberOfConsecutiveIndices(0),
47 if (parentSocket > parentPipe) {
110 throw cms::Exception(
"MulticoreCommunicationFailure") <<
"failed to send data to controller: errno=" << errno <<
" : " << strerror(errno);
112 throw cms::Exception(
"MulticoreCommunicationFailure") <<
"Unable to write full message to controller (" << rc <<
" of " << parentMessage.
sizeForBuffer() <<
" byte written)";
118 fd_set readSockets, errorSockets;
125 struct timeval tv; tv.tv_sec = 1; tv.tv_usec = 0;
126 while (((rc =
select(
m_maxFd, &readSockets,
NULL, &errorSockets, &tv)) < 0) && (errno == EINTR)) {}
132 if (errno == EPIPE) {
133 throw cms::Exception(
"MulticoreCommunicationFailure") <<
"Parent process appears to be dead.";
135 throw cms::Exception(
"MulticoreCommunicationFailure") <<
"Cannot write to parent: errno=" << errno <<
" : " << strerror(errno);
142 throw cms::Exception(
"MulticoreCommunicationFailure") <<
"Cannot communicate with parent (fd=" <<
m_parentSocket <<
"): errno=" << errno <<
" : " << strerror(errno);
146 throw cms::Exception(
"MulticoreCommunicationFailure") <<
"Unable to read from parent socket";
157 throw cms::Exception(
"MulticoreCommunicationFailure")<<
"failed to receive data from controller: errno="<<errno<<
" : "<<strerror(errno);
unsigned long m_numberOfConsecutiveIndices
unsigned long m_numberToSkip
static size_t sizeForBuffer()
static size_t sizeForBuffer()
unsigned long m_startIndex
MessageReceiverForSource(int parentSocket, int parentPipe)
Takes the fd of the read and write socket for communication with parent.