source: ntrip/trunk/BNC/src/upload/bncuploadcaster.h@ 11060

Last change on this file since 11060 was 11060, checked in by stuerze, 15 hours ago

another test is added

File size: 1.9 KB
Line 
1#ifndef BNCUPLOADCASTER_H
2#define BNCUPLOADCASTER_H
3
4#include <QDateTime>
5#include <QMutex>
6#include <QSslSocket>
7#include <QNetworkProxy>
8#include <QThread>
9#include <QSslError>
10#include <QSslKey>
11#include <iostream>
12
13
14class bncUploadCaster : public QThread {
15 Q_OBJECT
16 public:
17 bncUploadCaster(const QString& mountpoint,
18 const QString& outHost, int outPort,
19 const QString& ntripVersion,
20 const QString& userName, const QString& password,
21 int iRow, int rate);
22 virtual void deleteSafely();
23 void setOutBuffer(const QByteArray& outBuffer) {
24 QMutexLocker locker(&_mutex);
25 _outBuffer = outBuffer;
26 }
27 // Append data for streams forwarded chunk by chunk (raw upload): several
28 // chunks may arrive between two sends of the upload thread (every 0.1 s)
29 void appendOutBuffer(const QByteArray& data) {
30 QMutexLocker locker(&_mutex);
31 _outBuffer += data;
32 }
33
34 protected:
35 virtual ~bncUploadCaster();
36 QMutex _mutex;
37 QByteArray _outBuffer;
38
39 signals:
40 void newMessage(const QByteArray msg, bool showOnScreen);
41 void newBytes(QByteArray staID, double nbyte);
42
43 private slots:
44 void slotProxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*);
45 void slotSslErrors(QList<QSslError>);
46
47 private:
48 void open();
49 bool connectToHost(QString outHost, int outPort, bool encrypted);
50 virtual void run();
51 bool _isToBeDeleted;
52 QString _mountpoint;
53 QString _outHost;
54 int _outPort;
55 QString _casterOutHost;
56 int _casterOutPort;
57 QString _proxyOutHost;
58 int _proxyOutPort;
59 QString _crtFileName;
60 QString _keyFileName;
61 QString _userName;
62 QString _password;
63 QString _ntripVersion;
64 QString _postExtension;
65 bool _secure;
66 bool _sslIgnoreErrors;
67 bool _proxy;
68 QSslSocket* _outSocket;
69 int _sOpenTrial;
70 QDateTime _outSocketOpenTime;
71 int _iRow;
72 int _rate;
73};
74
75#endif
Note: See TracBrowser for help on using the repository browser.