void WebSocket::listen() { EthernetClient cli; if (cli = server.available()) { if (cli == true) { if (state == DISCONNECTED ) { client = cli; if (doHandshake() == true) { state = CONNECTED; if (onConnect) { onConnect(*this); } } } else { if (getFrame() == false) { // Got unhandled frame, disconnect #ifdef DEBUG Serial.println("Disconnecting"); #endif disconnectStream(); state = DISCONNECTED; if (onDisconnect) { onDisconnect(*this); } } } } } }
OutputIceCast::~OutputIceCast() { if (getState() == CONNECTED) disconnectStream(); shout_free(_shout); shout_shutdown(); }
void OutputIceCast::disable() { Output::disable(); if (getState() == CONNECTED) disconnectStream(); if (_timer->isActive()) _timer->stop(); }
void WebSocket::listen() { if( !client.available() ) return; if( !getFrame() ) // Got unhandled frame, disconnect disconnectStream(); }
WebSocket::WebSocket( WebSocketServer *server, EthernetClient cli ) : m_server(server), client(cli) { if( doHandshake() ) { state = CONNECTED; if( m_server->onConnect ) m_server->onConnect(*this); return; } disconnectStream(); }
void LiveWidget::setupStreamMenu() { foreach (QAction* action, this->streamMenu->actions()) this->streamMenu->removeAction(action); QList<DeviceModel> models = DatabaseManager::getInstance().getDevice(); foreach (DeviceModel model, models) { for (int i = 0; i < model.getChannels(); i++) { this->streamMenu->addAction(/*QIcon(":/Graphics/Images/RenameRundown.png"),*/ QString("Device: %1, Channel: %2 (Fill)").arg(model.getName()).arg(i + 1)); this->streamMenu->addAction(/*QIcon(":/Graphics/Images/RenameRundown.png"),*/ QString("Device: %1, Channel: %2 (Key)").arg(model.getName()).arg(i + 1)); } } this->streamMenu->addSeparator(); this->streamMenu->addAction(/*QIcon(":/Graphics/Images/RenameRundown.png"),*/ "Disconnect", this, SLOT(disconnectStream())); }