Index: /trunk/BNC/bncnetrequest2.cpp
===================================================================
--- /trunk/BNC/bncnetrequest2.cpp	(revision 1297)
+++ /trunk/BNC/bncnetrequest2.cpp	(revision 1297)
@@ -0,0 +1,102 @@
+/* -------------------------------------------------------------------------
+ * BKG NTRIP Client
+ * -------------------------------------------------------------------------
+ *
+ * Class:      bncNetRequest
+ *
+ * Purpose:    Prepare and submit network request
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    09-Dec-2008
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include <iostream>
+#include <iomanip>
+
+#include "bncnetrequest.h"
+
+using namespace std;
+
+#define AGENTVERSION "1.7"
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+bncNetRequest::bncNetRequest() {
+  _http = 0;
+  _buffer = new QBuffer();
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+bncNetRequest::~bncNetRequest() {
+  delete _buffer;
+  delete _http;
+}
+
+// Network Request
+////////////////////////////////////////////////////////////////////////////
+t_irc bncNetRequest::request(const QUrl& url, const QByteArray& ggaStr) {
+
+  // Network Access Manager
+  // ----------------------
+  if (_http == 0) {
+    _http = new QHttp();
+  }
+  else {
+    return failure;
+  }
+
+  connect(_http, SIGNAL(done(bool)), this, SLOT(slotDone(bool)));
+
+  connect(_http, SIGNAL(sslErrors(const QList<QSslError>&)), 
+          this, SLOT(slotSslErrors(const QList<QSslError>&)));
+  
+  // Proxy
+  // -----
+  QSettings settings;
+  QString proxyHost = settings.value("proxyHost").toString();
+  if (proxyHost.isEmpty()) {
+    QNetworkProxy proxy(QNetworkProxy::NoProxy);
+    _http->setProxy(proxy);
+  }
+  else {
+    QNetworkProxy proxy(QNetworkProxy::Socks5Proxy);
+    proxy.setHostName(proxyHost);
+    proxy.setPort(settings.value("proxyPort").toInt());
+    _http->setProxy(proxy);
+  }
+
+  cout << url.toEncoded().data() << endl;
+
+  _http->setHost("www.igs-ip.net");
+  _http->get("/", _buffer);
+
+
+  return success;
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncNetRequest::slotDone(bool error) {
+  if (error) {
+    cout << "slotDone ERROR " << _http->error() << endl
+         << _http->errorString().toAscii().data() << endl
+         << _http->lastResponse().toString().toAscii().data() << endl;
+  }
+  else {
+    cout << "slotDone OK" << endl;
+  }
+  cout << "Buffer >" << _buffer->data().data() << "<" << endl;
+  this->deleteLater();
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncNetRequest::slotSslErrors(const QList<QSslError>&) {
+  cout << "slotSslError" << endl;
+}
+
Index: /trunk/BNC/bncnetrequest2.h
===================================================================
--- /trunk/BNC/bncnetrequest2.h	(revision 1297)
+++ /trunk/BNC/bncnetrequest2.h	(revision 1297)
@@ -0,0 +1,25 @@
+#ifndef BNCNETREQUEST_H
+#define BNCNETREQUEST_H
+
+#include <QtNetwork>
+#include "bncconst.h"
+
+class bncNetRequest : public QObject {
+ Q_OBJECT
+
+ public:
+  bncNetRequest();
+  ~bncNetRequest();
+
+  t_irc request(const QUrl& url, const QByteArray& ggaStr);
+
+ private slots:
+  void slotDone(bool error);
+  void slotSslErrors(const QList<QSslError>& errors);
+
+ private:
+  QHttp*   _http;
+  QBuffer* _buffer;
+};
+
+#endif
