Archived
This forum has been archived. Please start a new discussion on GitHub.
server.exe communicate with client.exe problem.
ouloba
in Help Center
Why my server.exe and client.exe can communicate each other at same local machine but not at different machine. How can I do it right?
0
Comments
-
This means that your server is not running, or it is not running on the specified host/port.
Again, tracing will give you more information as to what address the client exactly tries to connect to, as well as what address the server listens to. Run both the client and the server with --Ice.Trace.Network=3.0 -
code here,
[server code]
int argc = 0;
Ice::PropertiesPtr properties = Ice::createProperties();
properties->setProperty("Hello.Endpoints", "tcp -p 10000");
properties->setProperty("Ice.Trace.Network", "3");
communicator = Ice::initializeWithProperties(argc, 0, properties);
log = new LogI;
communicator->setLogger(log);
adapter = communicator->createObjectAdapter("Hello");
properties->setProperty("Ice.Trace.Network", "3");
Ice::ObjectPrx obj = communicator->stringToProxy("Player:tcp -p 10001");
PlayerPrx::uncheckedCast(obj);
[client ode:]
PropertiesPtr properties = _communicator->getProperties();
properties->setProperty("Ice.Trace.Network", "3");
Ice::ObjectPrx obj = _communicator->stringToProxy("hello:tcp -p 10000");
_proxy = HelloPrx::uncheckedCast(obj);
_currentProxy = _proxy;
properties->setProperty("Ice.Trace.Network", "3");
properties->setProperty("Player.Endpoints", "tcp -p 10001");
ObjectAdapterPtr adapter = _communicator->createObjectAdapter("Player");
adapter->add(new PlayerI(), stringToIdentity("Player"));
adapter->activate();
_PlayerProxy = PlayerPrx::uncheckedCast(
adapter->createProxy(stringToIdentity("Player")));
what's problem with it?0 -
code here,
[server code]
int argc = 0;
Ice::PropertiesPtr properties = Ice::createProperties();
properties->setProperty("Hello.Endpoints", "tcp -p 10000");
properties->setProperty("Ice.Trace.Network", "3");
communicator = Ice::initializeWithProperties(argc, 0, properties);
log = new LogI;
communicator->setLogger(log);
adapter = communicator->createObjectAdapter("Hello");
properties->setProperty("Ice.Trace.Network", "3");
Ice::ObjectPrx obj = communicator->stringToProxy("Player:tcp -p 10001");
PlayerPrx::uncheckedCast(obj);
[client ode:]
PropertiesPtr properties = _communicator->getProperties();
properties->setProperty("Ice.Trace.Network", "3");
Ice::ObjectPrx obj = _communicator->stringToProxy("hello:tcp -p 10000");
_proxy = HelloPrx::uncheckedCast(obj);
_currentProxy = _proxy;
properties->setProperty("Ice.Trace.Network", "3");
properties->setProperty("Player.Endpoints", "tcp -p 10001");
ObjectAdapterPtr adapter = _communicator->createObjectAdapter("Player");
adapter->add(new PlayerI(), stringToIdentity("Player"));
adapter->activate();
_PlayerProxy = PlayerPrx::uncheckedCast(
adapter->createProxy(stringToIdentity("Player")));
what's problem with it?0
