Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MainWindow::on_pushButton_clicked()
- {
- meinServer = new QTcpServer(this);
- meinServer->listen(QHostAddress::Any, 12345);
- connect(meinServer, SIGNAL(newConnection()), this, SLOT(sendText()));
- }
- void MainWindow::sendText()
- {
- QTcpSocket * ClientSocket = meinServer->nextPendingConnection();
- char * buffer = "Hallo Welt";
- ClientSocket->write(buffer);
- ClientSocket->disconnectFromHost();
- }
Add Comment
Please, Sign In to add comment