]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/ExternalNet/ExternalNet.hxx
Do not run the HoldDown code until after the aircraft is trimmed to prevent a devide...
[flightgear.git] / src / FDM / ExternalNet / ExternalNet.hxx
index 92d76a3229a2c3b75946ffd1fd4aaeb942f9e7b9..899650b414771f597bf42728e8fa679c18cffe32 100644 (file)
 #ifndef _EXTERNAL_NET_HXX
 #define _EXTERNAL_NET_HXX
 
-#include <plib/netBuffer.h>
-#include <plib/netSocket.h>
-
 #include <simgear/timing/timestamp.hxx> // fine grained timing measurements
+#include <simgear/io/raw_socket.hxx>
 
 #include <Network/net_ctrls.hxx>
 #include <Network/net_fdm.hxx>
 #include <FDM/flight.hxx>
 
 
-class HTTPClient : public netBufferChannel
-{
-
-    bool done;
-    SGTimeStamp start;
-
-public:
-
-    HTTPClient ( const char* host, int port, const char* path ) :
-        done( false )
-    {
-       open ();
-       connect (host, port);
-
-       const char* s = netFormat ( "GET %s HTTP/1.0\r\n\r\n", path );
-       bufferSend( s, strlen(s) ) ;
-
-        start.stamp();
-    }
-
-    virtual void handleBufferRead (netBuffer& buffer)
-    {
-       const char* s = buffer.getData();
-       while (*s)
-           fputc(*s++,stdout);
-
-       printf("done\n");
-       buffer.remove();
-       printf("after buffer.remove()\n");
-        done = true;
-    }
-
-    bool isDone() const { return done; }
-    bool isDone( long usec ) const { 
-        if ( start + SGTimeStamp::fromUSec(usec) < SGTimeStamp::now() ) {
-            return true;
-        } else {
-            return done;
-        }
-    }
-};
-
-
 class FGExternalNet: public FGInterface {
 
 private:
@@ -83,10 +38,10 @@ private:
     int data_in_port;
     int data_out_port;
     int cmd_port;
-    string fdm_host;
+    std::string fdm_host;
 
-    netSocket data_client;
-    netSocket data_server;
+    simgear::Socket data_client;
+    simgear::Socket data_server;
 
     bool valid;
 
@@ -96,7 +51,7 @@ private:
 public:
 
     // Constructor
-    FGExternalNet( double dt, string host, int dop, int dip, int cp );
+    FGExternalNet( double dt, std::string host, int dop, int dip, int cp );
 
     // Destructor
     ~FGExternalNet();