diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2016-08-03 09:50:55 +0300 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2016-08-03 11:46:21 +0000 |
commit | 5a133a404ebaa5233d5370ace10ba9532b9c6adc (patch) | |
tree | 9544da1252cf7d7aff1d195186c160235bf5c49b /examples/network/multistreamserver/server.cpp | |
parent | 733c4de36e71fa58dc444a181d725bfa46699a16 (diff) |
Polish SCTP examples
- Introduce a common header file for client and server;
- Update license headers;
- Fix minor issues.
Change-Id: I3fc42fd5ba32141c702fc6679a27bf0b6a16fd26
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'examples/network/multistreamserver/server.cpp')
-rw-r--r-- | examples/network/multistreamserver/server.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/examples/network/multistreamserver/server.cpp b/examples/network/multistreamserver/server.cpp index 1fb18e80b9..3b06c0fd37 100644 --- a/examples/network/multistreamserver/server.cpp +++ b/examples/network/multistreamserver/server.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** ** Copyright (C) 2015 Alex Trotsenko <alex1973tr@gmail.com> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -47,9 +57,11 @@ #include "timeprovider.h" #include "chatprovider.h" +#include "../shared/sctpchannels.h" + Server::Server(QWidget *parent) : QDialog(parent) - , providers(NumberOfChannels) + , providers(SctpChannels::NumberOfChannels) { setWindowTitle(tr("Multi-stream Server")); @@ -59,15 +71,15 @@ Server::Server(QWidget *parent) statusLabel = new QLabel; QPushButton *quitButton = new QPushButton(tr("Quit")); - providers[Movie] = new MovieProvider(this); - providers[Time] = new TimeProvider(this); - providers[Chat] = new ChatProvider(this); + providers[SctpChannels::Movie] = new MovieProvider(this); + providers[SctpChannels::Time] = new TimeProvider(this); + providers[SctpChannels::Chat] = new ChatProvider(this); connect(sctpServer, &QSctpServer::newConnection, this, &Server::newConnection); connect(quitButton, &QPushButton::clicked, this, &Server::accept); - connect(providers[Movie], &Provider::writeDatagram, this, &Server::writeDatagram); - connect(providers[Time], &Provider::writeDatagram, this, &Server::writeDatagram); - connect(providers[Chat], &Provider::writeDatagram, this, &Server::writeDatagram); + connect(providers[SctpChannels::Movie], &Provider::writeDatagram, this, &Server::writeDatagram); + connect(providers[SctpChannels::Time], &Provider::writeDatagram, this, &Server::writeDatagram); + connect(providers[SctpChannels::Chat], &Provider::writeDatagram, this, &Server::writeDatagram); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(statusLabel); |