]> git.mxchange.org Git - flightgear.git/commitdiff
Tweaks to go along with changes in SGSocket.
authorcurt <curt>
Fri, 14 Jul 2000 00:50:56 +0000 (00:50 +0000)
committercurt <curt>
Fri, 14 Jul 2000 00:50:56 +0000 (00:50 +0000)
src/Main/fg_io.cxx
src/Main/options.cxx

index c3859db6e754f8e9ab55602416c0b192a5fb3df7..84e8696a6dc963a5c1fd994aa9af42f6921576a9 100644 (file)
@@ -158,23 +158,32 @@ static FGProtocol *parse_port_config( const string& config )
        ch->set_file_name( config.substr(begin) );
        FG_LOG( FG_IO, FG_INFO, "  file name = " << ch->get_file_name() );
     } else if ( medium == "socket" ) {
-       SGSocket *ch = new SGSocket;
-       io->set_io_channel( ch );
-
        // hostname
        end = config.find(",", begin);
        if ( end == string::npos ) {
            return NULL;
        }
     
-       ch->set_hostname( config.substr(begin, end - begin) );
+       string hostname = config.substr(begin, end - begin);
        begin = end + 1;
-       FG_LOG( FG_IO, FG_INFO, "  hostname = " << ch->get_hostname() );
+       FG_LOG( FG_IO, FG_INFO, "  hostname = " << hostname );
 
-       // port
-       ch->set_port_str( config.substr(begin) );
-       FG_LOG( FG_IO, FG_INFO, "  port string = " << ch->get_port_str() );
+       // port string
+       end = config.find(",", begin);
+       if ( end == string::npos ) {
+           return NULL;
+       }
+    
+       string port = config.substr(begin, end - begin);
+       begin = end + 1;
+       FG_LOG( FG_IO, FG_INFO, "  port string = " << port );
 
+       // socket style
+       string style_str = config.substr(begin);
+       FG_LOG( FG_IO, FG_INFO, "  style string = " << style_str );
+       
+       SGSocket *ch = new SGSocket( hostname, port, style_str );
+       io->set_io_channel( ch );
     }
 
     return io;
index f8bc50070dcaeec1d46a41be25c3f72da787d967..d4d9c06edf456a8919527514c7713cd6748c0131 100644 (file)
@@ -554,10 +554,11 @@ fgOPTIONS::parse_fov( const string& arg ) {
 //  device = OS device name of serial line to be open()'ed
 //  baud = {300, 1200, 2400, ..., 230400}
 //
-// Socket exacmple "--native=socket,dir,hz,machine,port" where
+// Socket exacmple "--native=socket,dir,hz,machine,port,style" where
 // 
 //  machine = machine name or ip address if client (leave empty if server)
 //  port = port, leave empty to let system choose
+//  style = tcp or udp
 //
 // File example "--garmin=file,dir,hz,filename" where
 //