From 1e6069805396dd487464ad6ca1178f033585eb6c Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 4 Oct 2000 21:55:11 +0000 Subject: [PATCH] Initial revision. --- simgear/io/socktest.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 simgear/io/socktest.cxx diff --git a/simgear/io/socktest.cxx b/simgear/io/socktest.cxx new file mode 100644 index 00000000..76ce67e5 --- /dev/null +++ b/simgear/io/socktest.cxx @@ -0,0 +1,21 @@ +#include + +#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); + } +} -- 2.39.5