开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: C++ preventing EReader reading when socket is closed


 

I guess the assumption is that using std::atomic<bool> m_isAlive; turns the following into a critical section:

void EReader::readToQueue() {
	//EMessage *msg = 0;

	while (m_isAlive) {
		if (m_buf.size() == 0 && !processNonBlockingSelect() && m_pClientSocket->isSocketOK())
			continue;

        if (!putMessageToQueue())
			break;
	}

But it does not, so I take your point.

Join twsapi@groups.io to automatically receive all group messages.