forked from guodong/cloudwarehub-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (40 loc) · 1.18 KB
/
main.cpp
File metadata and controls
53 lines (40 loc) · 1.18 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "mainwindow.h"
#include <QApplication>
#include <QtNetwork>
#include <QHostAddress>
#include "cipclient.h"
#include "cloudwaredialog.h"
MainWindow *mainwindow;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
mainwindow = new MainWindow();
mainwindow->show();
// /* connect to nat server */
// QString server_ip = "180.150.186.157";
// QHostAddress addr;
// addr.setAddress(server_ip);
// QTcpSocket *socket = new QTcpSocket();
// socket->connectToHost(addr, 999);
// if(!socket->waitForConnected()){
// qDebug("cannot connect to 999\n");
// return 0;
// }
// /* write cloudware instance id to nat server */
// socket->write("hello", 6);
// /* read nat port */
// quint16 port;
// if(!socket->waitForReadyRead()){
// qErrnoWarning("cannot get proxy port!");
// return 0;
// }
// socket->read((char*)&port, 2);
// qDebug("nat port: %d\n", port);
QString server_ip = "180.150.186.157";
quint16 port = 5999;
/* run cip client */
CipClient *cipclient = new CipClient(server_ip, port);
cipclient->mainwindow = mainwindow;
cipclient->run();
return a.exec();
}