Rev | Line | |
---|
[1344] | 1 | #ifndef BNCSOCKET_H
|
---|
| 2 | #define BNCSOCKET_H
|
---|
| 3 |
|
---|
| 4 | #include <QtNetwork>
|
---|
[1349] | 5 | #include "bncconst.h"
|
---|
[1344] | 6 |
|
---|
[1362] | 7 | class bncSocket : public QObject {
|
---|
[1354] | 8 | Q_OBJECT
|
---|
[1344] | 9 |
|
---|
| 10 | public:
|
---|
[1349] | 11 | bncSocket();
|
---|
[1344] | 12 | ~bncSocket();
|
---|
| 13 |
|
---|
[1345] | 14 | void close();
|
---|
| 15 | qint64 bytesAvailable() const;
|
---|
| 16 | bool canReadLine() const;
|
---|
[1364] | 17 | QByteArray readLine();
|
---|
[1363] | 18 | void waitForReadyRead(int msecs = 30000);
|
---|
[1368] | 19 | QByteArray read(qint64 maxSize);
|
---|
[1344] | 20 | QAbstractSocket::SocketState state() const;
|
---|
| 21 |
|
---|
[1349] | 22 | t_irc request(const QUrl& mountPoint, const QByteArray& latitude,
|
---|
| 23 | const QByteArray& longitude, const QByteArray& nmea,
|
---|
[1353] | 24 | const QByteArray& ntripVersion, int timeOut, QString& msg);
|
---|
[1346] | 25 |
|
---|
[1354] | 26 | signals:
|
---|
[1362] | 27 | void quitEventLoop();
|
---|
[1354] | 28 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
| 29 |
|
---|
[1355] | 30 | private slots:
|
---|
[1370] | 31 | void slotReplyFinished();
|
---|
| 32 | void slotReadyRead();
|
---|
| 33 | void slotError(QNetworkReply::NetworkError);
|
---|
| 34 | void slotSslErrors(const QList<QSslError>&);
|
---|
[1355] | 35 |
|
---|
[1344] | 36 | private:
|
---|
[1356] | 37 | t_irc request2(const QUrl& url, const QByteArray& latitude,
|
---|
[1355] | 38 | const QByteArray& longitude, const QByteArray& nmea,
|
---|
| 39 | int timeOut, QString& msg);
|
---|
| 40 |
|
---|
[1370] | 41 | QTcpSocket* _socket;
|
---|
| 42 | QNetworkAccessManager* _manager;
|
---|
| 43 | QNetworkReply* _reply;
|
---|
| 44 | QEventLoop* _eventLoop;
|
---|
| 45 | QByteArray _buffer;
|
---|
[1344] | 46 | };
|
---|
| 47 |
|
---|
| 48 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.