main.cpp 729 B

1234567891011121314151617181920212223
  1. /**
  2. * Qt signaling server example for libdatachannel
  3. * Copyright (c) 2022 cheungxiongwei
  4. *
  5. * This Source Code Form is subject to the terms of the Mozilla Public
  6. * License, v. 2.0. If a copy of the MPL was not distributed with this
  7. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  8. */
  9. #include "SignalingServer.h"
  10. #include <QCoreApplication>
  11. int main(int argc, char *argv[]) {
  12. QCoreApplication a(argc, argv);
  13. SignalingServer server;
  14. if (server.listen(QHostAddress("127.0.0.1"), 8000)) {
  15. qInfo() << "Listening on 127.0.0.1:8000";
  16. qInfo() << "server listening on 127.0.0.1:8000";
  17. } else {
  18. qDebug() << "[Errno 10000] error while attempting to bind on address ('127.0.0.1', 8000)";
  19. }
  20. return a.exec();
  21. }