|
anyKode Marilou
|
Connecting to MODA TCP server.
bool Connect(xkode::lib::String ServerIP);
|
Parameters |
Description |
|
xkode::lib::String ServerIP |
[in] MODA server IP address or network name. |
true if the connection could be established, false if not. In this last case, check if the MODA server is started (Exec is running) and that the port of the server is not blocked by a firewall. By default it is the port 13000 TCP and UDP.
#include "Modacpp.h"
#include "conio.h"
#define SIMULATEDROBOT "/robot1"
#define MODASERVER "localhost"
int main(int argc, TCHAR* argv[])
{
ModaCPP::Connection *connection=new ModaCPP::Connection(true);
if(connection->Connect(MODASERVER))
{
_cprintf("Connexion to %s ok\r\n",MODASERVER);
ModaCPP::RobotPHX *robot=connection->QueryRobotPHX(SIMULATEDROBOT);
if(robot)
{
cprintf("robot found\r\n");
}
else
{
cprintf("robot not found\r\n");
}
}
else
{
cprintf("Unable to connect to moda server : be sure Exec is running and MODA TCP/UDP ports are open\r\n");
}
connection->Disconnect();
return 0;
}|
Documentation v4.7 (30/07/2011), Copyright (c) 2011 anyKode. All rights reserved.
|
|
What do you think about this topic? Send feedback!
|