]> git.mxchange.org Git - simgear.git/commitdiff
Initial revision.
authorcurt <curt>
Wed, 4 Oct 2000 21:55:11 +0000 (21:55 +0000)
committercurt <curt>
Wed, 4 Oct 2000 21:55:11 +0000 (21:55 +0000)
simgear/io/socktest.cxx [new file with mode: 0644]

diff --git a/simgear/io/socktest.cxx b/simgear/io/socktest.cxx
new file mode 100644 (file)
index 0000000..76ce67e
--- /dev/null
@@ -0,0 +1,21 @@
+#include <unistd.h>
+
+#include "sg_socket.hxx"
+
+int main() {
+
+    SGSocket s( "", "5500", "tcp" );
+
+    if ( !s.open( SG_IO_BI ) ) {
+       cout << "error can't open socket\n";
+    }
+
+    char buf[256];
+
+    while ( true ) {
+       if ( s.readline( buf, 256 ) > 0 ) {
+           cout << "result = " << buf;
+       }
+       sleep(1);
+    }
+}