本文整理汇总了C++中processMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ processMessage函数的具体用法?C++ processMessage怎么用?C++ processMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了processMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processMessage
void PathDisplay::setColor(const Ogre::ColourValue& color)
{
color_ = color;
processMessage(current_message_);
causeRender();
}
示例2: processMessage
void Server::processMessageGroup(QString message_gr, quint32 ipaddr)
{
QStringList message_list = message_gr.split("\r\n", QString::KeepEmptyParts);
for(int i=0; i<message_list.size(); i++) {
processMessage(message_list.at(i), ipaddr);
}
}
示例3: while
void Socket::processingLoop() {
while (connected) {
std::unique_lock<std::mutex> lock(processingMutex);
while (connected && processingQueue.empty()) processingCondition.wait(lock);
if (connected) {
char *buffer = processingQueue.back();
processingQueue.pop_back();
lock.unlock();
std::unique_lock<std::mutex> handlerLock(handlerSwapMutex);
while (handlerSwapping) handlerSwapProcessingCondition.wait(handlerLock);
handlerLock.unlock();
activeProcessingCount++;
processMessage(buffer);
free(buffer);
activeProcessingCount--;
handlerSwapCondition.notify_all();
} else {
lock.unlock();
}
}
}
示例4: qDebug
// =====================================================================
// QWebSocket
// =====================================================================
void CWebSocketServer::onNewConnection()
{
qDebug() << "CWebSocketServer : New Connection";
QWebSocket *pSocket = m_pWebSocketServer->nextPendingConnection();
if (!pSocket) return;
m_clients.insert(pSocket, m_client_count);
m_clients_rev.insert(m_client_count, pSocket);
connect(pSocket, SIGNAL(textMessageReceived(QString)), this, SLOT(processMessage(QString)));
connect(pSocket, SIGNAL(binaryMessageReceived(QByteArray)), this, SLOT(processMessage(QByteArray)));
connect(pSocket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
emit connected(m_client_count);
m_client_count++;
}
示例5: cDebugDom
void AVReceiver::dataGet(std::string msg)
{
if (msg.find('\n') == std::string::npos &&
msg.find('\r') == std::string::npos)
{
//We have not a complete paquet yet, buffurize it.
recv_buffer += msg;
cDebugDom("output") << "Bufferize data.";
return;
}
if (!recv_buffer.empty())
{
//Put last data in buffer
recv_buffer += msg;
msg = recv_buffer;
recv_buffer.clear();
}
replace_str(msg, "\r\n", "\n");
replace_str(msg, "\r", "\n");
std::vector<std::string> tokens;
Utils::split(msg, tokens, "\n");
cDebugDom("output") << "Got " << tokens.size() << " messages.";
for(uint i = 0; i < tokens.size(); i++)
processMessage(tokens[i]);
}
示例6: D
void RenderWindow::repaint() {
D("Entering\n");
RenderWindowMessage msg;
msg.cmd = CMD_REPAINT;
(void) processMessage(msg);
D("Exiting\n");
}
示例7: processMessage
void GridCellsDisplay::setColor(const Ogre::ColourValue& color)
{
this->color = color;
processMessage(current_message_);
causeRender();
}
示例8: memset
void ClientNetwork::readData()
{
char msg[1024];
memset(msg, 0, 1024);
int len = clientSocket->read(msg, 1024);
emit processMessage(msg, len);
}
示例9: while
void Network::nextTick()
{
// Перекладываем все сообщения в temp_queue, чтобы не начать обрабатывать сообщения следующего тика
queue<Message> temp_queue;
while(!message_queue.empty()) {
temp_queue.push(message_queue.front());
message_queue.pop();
}
applyInstability();
if (temp_queue.empty())
{
idle_ticks++;
}
else
{
idle_ticks = 0;
while(!temp_queue.empty()) {
processMessage(temp_queue.front());
temp_queue.pop();
}
}
runIdleCalls();
}
示例10: processMessage
void Network::runIdleCalls()
{
for (int process_id = 0; process_id < processes.size(); ++process_id)
{
processMessage(Message(process_id));
}
}
示例11: while
void Connection::readyReadHandler()
{
while (true) {
size_t fileDescriptorsCount = 0;
size_t bytesToRead = m_readBuffer.size() - m_readBufferSize;
ssize_t bytesRead = readBytesFromSocket(m_socketDescriptor, m_readBuffer.data() + m_readBufferSize, bytesToRead,
m_fileDescriptors.data() + m_fileDescriptorsSize, &fileDescriptorsCount);
if (bytesRead < 0) {
// EINTR was already handled by readBytesFromSocket.
if (errno == EAGAIN || errno == EWOULDBLOCK)
return;
if (m_isConnected) {
WTFLogAlways("Error receiving IPC message on socket %d in process %d: %s", m_socketDescriptor, getpid(), strerror(errno));
connectionDidClose();
}
return;
}
m_readBufferSize += bytesRead;
m_fileDescriptorsSize += fileDescriptorsCount;
if (!bytesRead) {
connectionDidClose();
return;
}
// Process messages from data received.
while (true) {
if (!processMessage())
break;
}
}
}
示例12: waitFor
void C_GetTime::waitFor( void )
{
do
{
if( _timeSlice == true ) processMessage();
} while( !timeUp() );
}
示例13: zstr_recv
void MessageProcessor::processSocket()
{
char* msg = zstr_recv(zmqSocket_);
if (msg == nullptr) {
Log::Error("zeromq recv() failed\n");
return;
}
std::string requestString(msg);
zstr_free(&msg);
std::string responseString;
bool error = processMessage(requestString, responseString);
if (error) {
responseString = "";
}
int rc = zstr_send(zmqSocket_, responseString.c_str());
if (rc != 0) {
Log::vError("MessageProcessor: failed to send response\n"
"request:\n%s\n\n"
"response:\n%s\n\n",
requestString.c_str(), responseString.c_str());
}
}
示例14: while
void OSCController::update()
{
while (listener.hasWaitingMessages()) {
osc::Message msg;
listener.getNextMessage(&msg);
processMessage( msg );
}
}
示例15: connect
void Client::addSocket(QtWebsocket::QWsSocket *socket)
{
sockets << socket;
connect(socket, SIGNAL(frameReceived(QString)), this, SLOT(processMessage(QString)));
connect(socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
connect(socket, SIGNAL(pong(quint64)), this, SLOT(processPong(quint64)));
}