Network

ALNetwork is a local module ($AL_DIR/modules/lib) that manages network. ALNetwork functions are not available except the exit() method. Exit will close the server and delete the ALNetwork module.

Network encapsulates GSoap 2.7.12. If you have your own network, you can call the ALModule::exit() method or create a broker without a loading network:

// create a broker without network fBroker = AL::ALBroker::createBroker( "CameraViewerBroker", "", 0 ,pIP, pBrokerPort, true, pMediaPath, false); // load network fBroker->loadAndLaunchNetwork(qApp->applicationDirPath().toStdString() + "/", true); AL::ALPtr<Module> module = AL::ALModule::createModule<Module>(fBroker);

Client and server ping each other every two seconds. After 3 unsuccessful ping requests, the client and server disconnect from each other and broker created with keepalive=false exits the application. Heartbeat (i.e. the ping sent periodically) can be disactivated with loadAndLaunchNetwork:

// create a broker without network fBroker = AL::ALBroker::createBroker( "CameraViewerBroker", "", 0 ,pIP, pBrokerPort, true, pMediaPath, false); // load network fBroker->loadAndLaunchNetwork(qApp->applicationDirPath().toStdString() + "/", false); // remove heartbeat AL::ALPtr<Module> module = AL::ALModule::createModule<Module>(fBroker);





Copyright © 2010 Aldebaran-Robotics - All rights reserved