void ChatCore::tryconnect(const QString& nickname, const QString& ip, const QString& port) { auto thread = new QThread(this); if (server != nullptr) { server->destroy_connection(); delete server; } server = new Server(nickname.toStdString(), ip.toStdString(), port.toInt()); // server->moveToThread(thread); connect(thread, SIGNAL(started()), server, SLOT(establish_connection())); connect(server, SIGNAL(connected()), this, SLOT(connection_established())); connect(server, SIGNAL(readyRead()), this, SLOT(message_received())); connect(server, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connection_failed(QAbstractSocket::SocketError))); connect(server, SIGNAL(stop_thread()), thread, SLOT(quit())); thread->start(); }
static void eos_message_received (GstBus * bus, GstMessage * message, GstPipeline * pipeline) { message_received (bus, message, pipeline); gtk_main_quit (); }
static void fsb_payload64_16_reply(struct bench_binding *b, int64_t p0, int64_t p1, int64_t p2, int64_t p3, int64_t p4, int64_t p5, int64_t p6, int64_t p7, int64_t p8, int64_t p9, int64_t p10, int64_t p11, int64_t p12, int64_t p13, int64_t p14, int64_t p15) { message_received(); }
void UDPServer::pump() { if (!m_initialized) return; struct timeval timev; timev.tv_sec = 0; timev.tv_usec = 5; fd_set fds; FD_ZERO(&fds); FD_SET(m_socket, &fds); int n = ::select(m_socket, &fds, NULL, NULL, &timev); if (n == 0) { // Select timeout return; } else if (n == -1) { log::error("UDPServer: Select error."); return; } struct sockaddr_in remote_addr; int length = sizeof(remote_addr); char buffer[m_buffer_size]; int received = ::recvfrom(m_socket, buffer, m_buffer_size, 0, (SOCKADDR*)&remote_addr, &length); buffer[received] = '\0'; // null-terminate buffer message_received(buffer); }
void on_message(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *mosq_message) { pthread_mutex_lock(&mutex); message_received(mosq_message->payload, mosq_message->payloadlen); pthread_mutex_unlock(&mutex); fflush(stdout); }
void GameClient::data_received(const char* msg, unsigned msg_len) { if (Message::Reconstruct(m_message_buffer, m_message_buffer_end, msg, msg_len)) { // Parse the full received message. char message[Message::s_buflen]; memset(message, 0, Message::s_buflen); while(Message::CopyInto(message, m_message_buffer, m_message_buffer_end)) { message_received(message); memset(message, 0, Message::s_buflen); } } }
void SIP::Conversation::receive_message (const Ekiga::Message& message) { // if the endpoint doesn't put a real name, we'll try to find one Ekiga::Message msg = { message.time, heap->get_name (message.name), message.payload }; messages.push_back (msg); message_received (msg); unreads++; updated(); }
static void fsb_buffer_reply(struct bench_binding *b, uint8_t *payload, size_t size) { message_received(); free(payload); }
static void fsb_payload64_8_reply(struct bench_binding *b, int64_t p0, int64_t p1, int64_t p2, int64_t p3, int64_t p4, int64_t p5, int64_t p6, int64_t p7) { message_received(); }
static void fsb_payload64_4_reply(struct bench_binding *b, int64_t payload0, int64_t payload1, int64_t payload2, int64_t payload3) { message_received(); }
static void fsb_payload64_2_reply(struct bench_binding *b, int64_t p0, int64_t p1) { message_received(); }
static void fsb_payload32_1_reply(struct bench_binding *b, int32_t p0) { message_received(); }
static void fsb_empty_reply(struct bench_binding *b) { message_received(); }