シンプルなWebSocketチャット
WebSocketプロトコルを使用したシンプルなチャットアプリケーション。
このアプリケーションでは、QWebSocket およびQWebSocketServer クラスを使用して、WebSocketプロトコル上で最小限のチャットアプリケーションを作成する方法を示しています。このサンプルは、複数のクライアントが接続してメッセージの送受信を行えるサーバーです。
デフォルトでは、localhostのポート1234でリスニングします。接続中のすべてのクライアントを追跡しており、いずれかのクライアントがサーバーにメッセージを送信するたびに、そのメッセージは他のすべてのクライアントに転送されます。クライアントが切断されると、クライアントリストから削除されます。

また、サーバーへの接続・切断、接続状態の確認、メッセージの送信、および他のクライアントから送信されたすべてのメッセージの表示を行うためのHTMLクライアントも用意されています。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.