#include <sstream>
#include <iostream>
+#include <errno.h>
#include <Main/globals.hxx>
#include <Main/viewmgr.hxx>
-#include <plib/netChat.h>
+#include <simgear/io/sg_netChat.hxx>
#include "props.hxx"
* Props connection class.
* This class represents a connection to props client.
*/
-class PropsChannel : public netChat
+class PropsChannel : public simgear::NetChat
{
- netBuffer buffer;
+ simgear::NetBuffer buffer;
/**
* Current property node name.
if ( !globals->get_commands()
->execute( "reinit", &args) )
{
- SG_LOG( SG_GENERAL, SG_ALERT,
+ SG_LOG( SG_NETWORK, SG_ALERT,
"Command " << tokens[1] << " failed.");
if ( mode == PROMPT ) {
tmp += "*failed*";
if ( !globals->get_commands()
->execute(tokens[1].c_str(), &args) )
{
- SG_LOG( SG_GENERAL, SG_ALERT,
+ SG_LOG( SG_NETWORK, SG_ALERT,
"Command " << tokens[1] << " failed.");
if ( mode == PROMPT ) {
tmp += "*failed*";
} else {
throw FGProtocolConfigError( "FGProps: incorrect number of configuration arguments" );
}
+ printf( "Property server started on port %d\n", port );
}
/**
return false;
}
- netChannel::open();
- netChannel::bind( "", port );
- netChannel::listen( 5 );
+ simgear::NetChannel::open();
+ simgear::NetChannel::bind( "", port );
+ simgear::NetChannel::listen( 5 );
SG_LOG( SG_IO, SG_INFO, "Props server started on port " << port );
set_enabled( true );
bool
FGProps::process()
{
- netChannel::poll();
+ simgear::NetChannel::poll();
return true;
}
void
FGProps::handleAccept()
{
- netAddress addr;
+ simgear::IPAddress addr;
int handle = accept( &addr );
SG_LOG( SG_IO, SG_INFO, "Props server accepted connection from "
<< addr.getHost() << ":" << addr.getPort() );