|
|
|
|||||
|
Problems 3.1 client --> 3.2 server
Hello,
We have just updated to v3.2 of ICE, though we have an existing C++ client API that uses the 3.1 framework that still needs to be supported. So far this client is unable to unpack any data successfully. Our C# clients using either 3.1 or 3.2 versions of ICE appear to work end to end against this 3.2 server. This is the exception received.. ProtocolException: _file 0x007266bc "f:\src\vc60\stage\Ice-3.1.1\src\ice\BasicStream.cpp" _line 398 reason "" (just empty string) The exception is thrown when making the following call in the auto generated wrapper: __is->readPendingObjects(); Where: ::IceInternal::BasicStream* __is = __og.is(); Has anyone got any ideas? cheers James |
|
|||||
|
Hi Mark, thanks for answering. In answer to your questions;
Our server is C# .NET 2.0 and is using Ice 3.2. The server does appear to process requests from this particular client and no errors are reported/logged there. Our C++ 3.1 client is communicating directly with the server, we haven't used any Glacier/Grid, etc. functionality in this application. Acually, your last point about slice defs got me thinking and this could be where the problem indeed lies. A month or so ago, we updated a small section of our slice definition and released to some integration test servers using Ice 3.1. All testing was successful with our .NET clients (e.g. those with newer slice defs and those with older slice defs). We still have these test servers in place so I pointed the problematic C++ client (with the old slice defs) to this server and it blew up with the same way as reported earlier. A protocol exception. So Ice 3.1 --> 3.2 does not appear to be the issue any more. It is now why do .NET clients with older slice defs communicate successfully with a server utilising newer slice defs, when our C++ equivalent does not? The slice definitions were extended like below. /************************************************** **** Version 2 changes ****************************/ module SliceV2{ class TsrIceEnrichedFieldDef extends Slice::TsrIceEnrichedFieldDef { bool IsFixedSchema; }; interface ITsrQueryDistributor extends Slice::ITsrQueryDistributor { }; }; The hosted server implementation was defined like so public class TsrQueryDistributorImpl : SliceV2.ITsrQueryDistributorDisp_, IDistributorInitialisable { ..... } And we used 2 facets, like so... string identity = ""; TsrQueryDistributorImpl distributor = new TsrQueryDistributorImpl(); adapter.addFacet((IceObject) distributor, communicator().stringToIdentity(identity), ""); //default adapter.addFacet((IceObject) distributor, communicator().stringToIdentity(identity), "v2"); Clients using the old slice defs would use the default empty string facet. The C++ code to instantiate the proxy is below.. // create the proxy to the server Ice::ObjectPrx base = (*((Ice::CommunicatorPtr*)(_pDistributorProxy->GetIceCommunicator())))-> stringToProxy(_connectionString); _pQueryProxy = new Slice::ITsrQueryDistributorPrx(); *(_pQueryProxy) = Slice::ITsrQueryDistributorPrx::uncheckedCast(base ); Have you got any ideas? cheers James |
|
||||||
|
From this description what you've done should work. However, you haven't really shown enough of the code or slice definitions to try and isolate the cause of the problem. Your C++ & C# code looks pretty strange also:
Code:
string identity = ""; TsrQueryDistributorImpl distributor = new TsrQueryDistributorImpl(); adapter.addFacet((IceObject) distributor, communicator().stringToIdentity(identity), ""); //default adapter.addFacet((IceObject) distributor, communicator().stringToIdentity(identity), "v2"); Code:
// create the proxy to the server Ice::ObjectPrx base = (*((Ice::CommunicatorPtr*)(_pDistributorProxy->GetIceCommunicator())))-> stringToProxy(_connectionString); Code:
_pQueryProxy = new Slice::ITsrQueryDistributorPrx(); *(_pQueryProxy) = Slice::ITsrQueryDistributorPrx::uncheckedCast(base ); Code:
_pQueryProxy = Slice::ITsrQueryDistributorPrx::uncheckedCast(base ); With all of the casting and unnecessary memory management I wouldn't be surprised if your C++ code has some nasty problem lurking. |
|
|||||
|
Thanks for the input,
yep, as you point out the identity isn't really empty string, I just removed the actual value to male the example a little clearer. I guess that it didn't work. Similarly, the casting when adding the servant is a hangover from converting working code to example code. Sorry. All the servants to be hosted are stored in a .NET 1.1 dictionary and needed casting from object type, like soCode:
IDictionary _servants;
(...populate _servants...)
foreach (string identity in _servants.Keys)
{
adapter.addFacet((IceObject) _servants[identity], communicator().stringToIdentity(identity), ""); //default
adapter.addFacet((IceObject) _servants[identity], communicator().stringToIdentity(identity), "v2");
}
As you point out the c++ code base is not optimal though, I will have to look at it a bit more closely. regards James |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| vector<string> clean up bombs client | shadowdog | Help Center | 9 | 03-09-2006 06:36 PM |
| send an object client -> server | arnaud | Help Center | 3 | 02-23-2006 08:29 PM |
| How can client know the status that client and server disconnceted? | skyriver | Help Center | 2 | 06-08-2005 12:37 AM |
| when the "XREF" will be edited to <<distributed Programming with ICE>> | libaoli | Help Center | 2 | 01-11-2005 09:57 PM |
| How server initiatively send message to client, and client can responce to it? | ouloba | Help Center | 3 | 11-26-2004 10:35 AM |