void QQmlWebSocketServer::setListen(bool listen) { if (listen == m_listen) { return; } m_listen = listen; emit listenChanged(listen); updateListening(); }
void QQmlWebSocketServer::setHost(const QString &host) { if (host == m_host) { return; } m_host = host; emit hostChanged(host); emit urlChanged(url()); updateListening(); }
void QQmlWebSocketServer::init() { // TODO: add support for wss, requires ssl configuration to be set from QML - realistic? m_server.reset(new QWebSocketServer(m_name, QWebSocketServer::NonSecureMode)); connect(m_server.data(), &QWebSocketServer::newConnection, this, &QQmlWebSocketServer::newConnection); connect(m_server.data(), &QWebSocketServer::serverError, this, &QQmlWebSocketServer::serverError); connect(m_server.data(), &QWebSocketServer::closed, this, &QQmlWebSocketServer::closed); updateListening(); }
void QQmlWebSocketServer::setPort(quint16 port) { if (port == m_port) { return; } m_port = port; emit portChanged(port); emit urlChanged(url()); if (m_componentCompleted && m_server->isListening()) { updateListening(); } }
void PresentationAvailability::setState(State state) { m_state = state; updateListening(); }
void PresentationAvailability::didChangeVisibilityState(PageVisibilityState visibility) { updateListening(); }
void PresentationAvailability::pageVisibilityChanged() { if (m_state == State::Inactive) return; updateListening(); }