-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (34 loc) · 816 Bytes
/
main.cpp
File metadata and controls
40 lines (34 loc) · 816 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* janus-server-c
*
* A server-side console application that is a C++ implementation of the Janus Presence Server.
*
* Author: James McCrae, Janus VR, Inc.
*
*/
#include <QCoreApplication>
#include <QPointer>
#include <QTimer>
#include "server.h"
int main(int argc, char *argv[])
{
//port defaults
int wsport = 5566;
int udpport = 5568;
//process cmd line args
for (int i=1; i<argc; ++i) {
QString arg=argv[i];
if (arg == "-wsport" && i < argc-1) {
++i;
wsport = QString(argv[i]).toInt();
}
else if (arg == "-udpport" && i < argc-1) {
++i;
udpport = QString(argv[i]).toInt();
}
}
//start server
QCoreApplication a(argc, argv);
Server s(wsport, udpport);
return a.exec();
}