summaryrefslogtreecommitdiff
path: root/examples/websockets/doc/simplechat.qdoc
blob: a89ab4b0144f046fed66384b02227e52f307823d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

/*!
    \example simplechat
    \title Simple WebSocket Chat
    \examplecategory {Networking}
    \ingroup qtwebsockets-examples
    \brief A minimal chat application using the WebSocket protocol.

    This application shows how to use the QWebSocket and QWebSocketServer
    classes to create a minimalist chat application over the WebSocket protocol.
    The example is a server that allows multiple clients to connect to it to send
    and receive messages.

    By default it listens at localhost port 1234. It keeps track of all clients
    that are connected to it, and each time one of the clients sends a message to
    the server, the message is forwarded to all other clients. When a client
    disconnects, it is removed from the list of clients.

    \image simplechat-html-example.webp Simple WebSocket Chat HTML Client

    There is also an HTML-client that is used to connect to and disconnect from
    the server, query about the connection, send messages, and view all the
    messages sent by other clients.

*/