LAN/WAN problems

in Help Center
I have the following ICE objects:
PlayerManager::find
This is the problem: When the client and the server are both in the local network (LAN), everything works fine. The method "find" finds and creates the correct object, which I use after that. And example of the code for the client:
When the client and the server are not on the same LAN (i.e. across the internet), this line...
ProfileDetails details = prx->getProfile();
...after a certain amount of time, generates an error for the client:
External exception EEFFACE.
...and an error for the server:
[ 09/13/07 23:06: 50.531 warning: connection exception:
TcpTransceiver.cpp:297: Ice::ConnectionLostException: Connection lost: WSAECONNRESET
Local address = xxx.xxx.xxx.xxxx
Remote address = yyy.yyy.yyy ]
[ 09/13/07 23:06:50.531 Network: shutting down tcp connection for reading and writing
Local address = xxx.xxx.xxx.xxxx
Remote address = yyy.yyy.yyy ]
[ 09/13/07 23:06:50.531 Network: closing tcp connection
Local address = xxx.xxx.xxx.xxx
Remote address = yyy.yyy.yyy ]
I'm using this software: CodeGear RAD 2007 C++ Builder & Ice 3.2.1
Here's how it works:dictionary<string, string> ProfileDetails;
class Player {
............
............
void setProfile(ProfileDetails newProfile);
ProfileDetails getProfile();
string name;
ProfileDetails profile;
};
interface PlayerManager
{
Player* add(ProfileDetails profile) throws PlayerExistExceptions;
Player* find(string username);
};
PlayerManager::find
PlayerPrx PlayerManagerI::find(const ::std::string& name, const ::Ice::Current& c )
{
IceUtil::Mutex::Lock lock(*this);
int count = _index->count(name);
if (count ==0) return 0;
vector<Ice::Identity> idents = _index->find(name);
return PlayerPrx::uncheckedCast(c.adapter->createProxy(idents[0]));
};
This is the problem: When the client and the server are both in the local network (LAN), everything works fine. The method "find" finds and creates the correct object, which I use after that. And example of the code for the client:
PlayerPrx prx = playerManager->find(username);
if (prx)
{
ProfileDetails details = prx->getProfile();
.....................
.....................
....................
}
When the client and the server are not on the same LAN (i.e. across the internet), this line...
ProfileDetails details = prx->getProfile();
...after a certain amount of time, generates an error for the client:
External exception EEFFACE.
...and an error for the server:
[ 09/13/07 23:06: 50.531 warning: connection exception:
TcpTransceiver.cpp:297: Ice::ConnectionLostException: Connection lost: WSAECONNRESET
Local address = xxx.xxx.xxx.xxxx
Remote address = yyy.yyy.yyy ]
[ 09/13/07 23:06:50.531 Network: shutting down tcp connection for reading and writing
Local address = xxx.xxx.xxx.xxxx
Remote address = yyy.yyy.yyy ]
[ 09/13/07 23:06:50.531 Network: closing tcp connection
Local address = xxx.xxx.xxx.xxx
Remote address = yyy.yyy.yyy ]
I'm using this software: CodeGear RAD 2007 C++ Builder & Ice 3.2.1
0
Comments
The warning you see on the server simply indicates that your client has crashed, and thus the connection has been reset.
Note that C++ Builder 2007 is not one of our supported compilers.
Bojko
So it sounds like Ice invocation is failing and throwing an exception which you should catch and handle...
So you should instead do something like:
Of course you may need to do more appropriate error handling.
It's :
IceUtil::Exception
File :Network.cpp
Line: 670
Error: 10060
stack dump:
getProfile failed: Network.cpp:670: Ice::ConnectFailedException:
connect failed: WSAETIMEDOUT
source:
Note that in most cases, such a timeout is caused by a firewall, i.e., the firewall blocks the connection to the specified host/port. This would also explain why you see the problem on the WAN only, but not on the LAN.
I'm using the Playermanager object, and after the problem happens I can still continue to use Playermanager. The connection is lost only when I try to use the result of Playermanager->Find()/login()
How can it be the firewall if the connection is lost ONLY when I use the server-side created object? Any other ideas on what could cause this problem?
Server log:
but your advice sounds absolutely incompetent.
The same server and client was running on VS C/C++ without any problems.
$(iceroot)\demo\book\freeze_filesystem
It doesn't work! Stops in the middle with an exception!
As for the Freeze problem, you should start a separate thread for this, and give the details of the error message you are seeing.
As an aside, I don't give a hoot about what you explain or don't explain to your boss...
Thank you in advance!
I apologize if I was offensive, I didn't mean to be
- What IP address & port the server is running on.
- What IP address & port the client is trying to connect with.
If these are not the same, then you know what the issue is and can work out how to solve this. If they are the same, and the connection attempt is failing there are various possibilities. A couple off the top of my head:
- A firewall is blocking connection attempts. This could either be locally, or remotely. You can help discover this by manually attempting to connect using telnet. For example, if your server is running on port 10000 on host 1.2.3.4 then you can run "telnet 1.2.3.4 10000".
- The connection takes some time and your timeout is configured too low.
Finally, there could be a compiler bug. As Marc previously told you the version of the Borland C++ compiler you are using is not supported and when we did the port to the prior version of this compiler we found it to be extremely buggy and had to discover numerous workarounds over the multitudes of problems that we discovered. Its entirely possible that there are either new bugs in the updated version of the compiler... The fact that another demo is failing for you does not bode well. Do the test suites run?
Thank you for your time.