]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/metar_main.cxx
Sink position-init code into its own file.
[flightgear.git] / src / Main / metar_main.cxx
index a80c1da2c0200be9a79427274288bbbbe13b880f..b1a39078afdb5d98df13fa9671493c7dd713ff97 100644 (file)
@@ -33,8 +33,8 @@
 
 #include <simgear/io/HTTPClient.hxx>
 #include <simgear/io/HTTPRequest.hxx>
+#include <simgear/io/raw_socket.hxx>
 #include <simgear/timing/timestamp.hxx>
-#include <simgear/misc/sg_sleep.hxx>
 
 using namespace std;
 using namespace simgear;
@@ -548,6 +548,8 @@ int main(int argc, char *argv[])
        string proxy_host, proxy_port;
        getproxy(proxy_host, proxy_port);
 
+  Socket::initSockets();
+  
     HTTP::Client http;
     http.setProxy(proxy_host, atoi(proxy_port.c_str()));
     
@@ -576,6 +578,7 @@ int main(int argc, char *argv[])
 
                        try {
                 MetarRequest* mr = new MetarRequest(argv[i]);
+                HTTP::Request_ptr own(mr);
                 http.makeRequest(mr);
                 
             // spin until the request completes, fails or times out
@@ -585,7 +588,7 @@ int main(int argc, char *argv[])
                     if (mr->complete || mr->failed) {
                         break;
                     }
-                    sleepForMSec(1);
+                    SGTimeStamp::sleepForMSec(1);
                 }
                 
                 if (!mr->complete) {