Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 10-19-2004
ouloba ouloba is offline
Registered User
 
 
Join Date: Sep 2004
Posts: 19
server.exe communicate with client.exe problem.

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?
Reply With Quote
  #2 (permalink)  
Old 10-19-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Switch on network tracing, so that you see what network address the server listens on, and to which address the client tries to connect to. Use --Ice.Trace.Network=3.
Reply With Quote
  #3 (permalink)  
Old 10-19-2004
ouloba ouloba is offline
Registered User
 
 
Join Date: Sep 2004
Posts: 19
I try it, but have a other problem!

/ice/ice-1.5.1/src/ice/network.cpp: 509 Ice::ConnectionRefuseException:connect refused:WSAECONNREFUSED
Reply With Quote
  #4 (permalink)  
Old 10-20-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
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.
Reply With Quote
  #5 (permalink)  
Old 10-20-2004
ouloba ouloba is offline
Registered User
 
 
Join Date: Sep 2004
Posts: 19
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?
Reply With Quote
  #6 (permalink)  
Old 10-20-2004
ouloba ouloba is offline
Registered User
 
 
Join Date: Sep 2004
Posts: 19
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?
Reply With Quote
  #7 (permalink)  
Old 10-20-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Again, please have a look at the trace output for both the client and the server, then you will find out what the problem is. You should not set any special logger for that, but use the standard logger that just logs to standard output.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
No problem in Vc7.0 client and Vc7.0 Server zhoubin Help Center 0 11-24-2006 03:27 AM
problem with server connect client(in a private network) hero107 Help Center 4 02-21-2006 03:17 AM
problem with server connect client hero107 Help Center 3 02-20-2006 08:01 AM
Encoding Problem about Chinese, client compiled by Java, server compiled by C++ richardma Help Center 6 12-21-2005 12:00 AM
server communicate with client without client's request chunlin Help Center 1 09-12-2003 08:18 AM


All times are GMT -4. The time now is 05:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.