1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #ifndef TCP_H
- #define TCP_H
- #include <QMainWindow>
- #include <QTcpServer>
- #include <QTcpSocket>
- #include <QLabel>
- #include <QFile>
- namespace Ui {
- class tcp;
- }
- class tcp : public QMainWindow
- {
- Q_OBJECT
- public:
- explicit tcp(QWidget *parent = nullptr);
- ~tcp();
- private slots:
- void on_setListen_clicked();
- void connectClient(QTcpSocket *clientSocket);
- void on_sendMsg_clicked();
- private:
- Ui::tcp *ui;
- QTcpServer* ms;
- QTcpSocket* mtcp;
- QLabel* mstatus;
- // QFile *file;
- QMap<QTcpSocket*, QString> connectedClients;
- QString sendname;
- int connectNum;
- int clientIdentifierCounter = 1;
- };
- #endif // TCP_H
|