Example #1
0
Server::Server(QObject *parent, LabelClass * lbl) :
    QObject(parent)
{
    server = new QTcpServer(this);
    connect(server, SIGNAL(newConnection()),
            this, SLOT(on_newConnection()));

    labelMsg = lbl;
}
Example #2
0
int main(int argc, char *argv[])
{
   QCoreApplication a(argc, argv);
   unsigned short port = 6007;

   simulator sim;
   QTcpServer tcp_server;

   init_remote_interfaces();

   sim_con = new simulator_connection(&tcp_server, &sim);

   tcp_server.listen(QHostAddress::Any, port);
   QObject::connect(&tcp_server, SIGNAL(newConnection()), sim_con, SLOT(on_newConnection()));

   return a.exec();
}