Archived
This forum has been archived. Please start a new discussion on GitHub.
About Communicator & glacier2
in Help Center
My program used glacier2 to network, but occur a strange error.
Please help me ,thanks
Following paragraph is my config file content
***************************************
Ice.Default.Router=UVSPGlacier2/router:tcp -p 10005 -h 192.168.39.161
Ice.Override.Timeout=-1
nonRouterAdapter.Endpoints=tcp -p 10000
IceStormTopic.Proxy = UVSPIceStorm/TopicManager:default -p 9995
ValidationSvt.Proxy=ValidationSvt:tcp -h 127.0.0.1 -p 9997
Lobby.Proxy = Lobby:tcp -h 127.0.0.1 -p 9993
lgBridge.Proxy = lgBridge:tcp -p 10000
VerifyClient.Proxy=VerifyClient:tcp -p 10000
Ice.ACM.Client=0
Ice.MonitorConnections=0
Ice.RetryIntervals=-1
Ice.Warn.Connections=1
***************************************
Following is error C# code
*******************************************
public override int run(string[] args)
{
Ice.RouterPrx pdefaultRouter = communicator().getDefaultRouter();
if (pdefaultRouter == null)
{
return -1;
}
Glacier2.RouterPrx pGRouter = Glacier2.RouterPrxHelper.checkedCast(pdefaultRouter);
if (pGRouter == null)
{
return -1;
}
Glacier2.SessionPrx sp;
try
{
sp = pGRouter.createSession("name", "pwd");
}
catch (Glacier2.PermissionDeniedException ex)
{
}
catch (Glacier2.CannotCreateSessionException ex)
{
}
Ice.ObjectPrx pobj = null;
try
{
gRouterAdapter = communicator().createObjectAdapterWithRouter("GlobeRouterAdapter", pGRouter);
ValidateClient.getValidClient();
UVSP.UserManager.UserAgentPrx pUA = null;
Ice.ObjectPrx obj = communicator().propertyToProxy("ValidationSvt.Proxy");
UVSP.ValidationPrx ValiPrx = UVSP.ValidationPrxHelper.checkedCast(obj);
ValiPrx.Validate("leo", "pwd", out pUA);
gAdapter = communicator().createObjectAdapter("nonRouterAdapter");
pobj = gAdapter.add(new ClgBridge(), communicator().stringToIdentity("lgBridge"));
pobj = gAdapter.add(ValidateClient.getValidClient(), communicator().stringToIdentity("VerifyClient"));
UVSPClient.CheckObjectPrx pCO = UVSPClient.CheckObjectPrxHelper.checkedCast(pobj);
ValiPrx.Validate("leo", "pwd", out pUA); //this occur error???
gRouterAdapter.activate();
gAdapter.activate();
}
catch (Ice.Exception Ex) { }
communicator().waitForShutdown();
return 0;
}
******************************************
this Class inherit from Ice.Application.
Please help me ,thanks
Following paragraph is my config file content
***************************************
Ice.Default.Router=UVSPGlacier2/router:tcp -p 10005 -h 192.168.39.161
Ice.Override.Timeout=-1
nonRouterAdapter.Endpoints=tcp -p 10000
IceStormTopic.Proxy = UVSPIceStorm/TopicManager:default -p 9995
ValidationSvt.Proxy=ValidationSvt:tcp -h 127.0.0.1 -p 9997
Lobby.Proxy = Lobby:tcp -h 127.0.0.1 -p 9993
lgBridge.Proxy = lgBridge:tcp -p 10000
VerifyClient.Proxy=VerifyClient:tcp -p 10000
Ice.ACM.Client=0
Ice.MonitorConnections=0
Ice.RetryIntervals=-1
Ice.Warn.Connections=1
***************************************
Following is error C# code
*******************************************
public override int run(string[] args)
{
Ice.RouterPrx pdefaultRouter = communicator().getDefaultRouter();
if (pdefaultRouter == null)
{
return -1;
}
Glacier2.RouterPrx pGRouter = Glacier2.RouterPrxHelper.checkedCast(pdefaultRouter);
if (pGRouter == null)
{
return -1;
}
Glacier2.SessionPrx sp;
try
{
sp = pGRouter.createSession("name", "pwd");
}
catch (Glacier2.PermissionDeniedException ex)
{
}
catch (Glacier2.CannotCreateSessionException ex)
{
}
Ice.ObjectPrx pobj = null;
try
{
gRouterAdapter = communicator().createObjectAdapterWithRouter("GlobeRouterAdapter", pGRouter);
ValidateClient.getValidClient();
UVSP.UserManager.UserAgentPrx pUA = null;
Ice.ObjectPrx obj = communicator().propertyToProxy("ValidationSvt.Proxy");
UVSP.ValidationPrx ValiPrx = UVSP.ValidationPrxHelper.checkedCast(obj);
ValiPrx.Validate("leo", "pwd", out pUA);
gAdapter = communicator().createObjectAdapter("nonRouterAdapter");
pobj = gAdapter.add(new ClgBridge(), communicator().stringToIdentity("lgBridge"));
pobj = gAdapter.add(ValidateClient.getValidClient(), communicator().stringToIdentity("VerifyClient"));
UVSPClient.CheckObjectPrx pCO = UVSPClient.CheckObjectPrxHelper.checkedCast(pobj);
ValiPrx.Validate("leo", "pwd", out pUA); //this occur error???
gRouterAdapter.activate();
gAdapter.activate();
}
catch (Ice.Exception Ex) { }
communicator().waitForShutdown();
return 0;
}
******************************************
this Class inherit from Ice.Application.
0
Comments
-
Nobody can answer me?
or
Description no detail?
0 -
Error with communicator & glacier2
My program used glacier2 to network, but occur a strange error.
Please help me ,thanks
Following paragraph is my config file content
***************************************
Ice.Default.Router=UVSPGlacier2/router:tcp -p 10005 -h 192.168.39.161
Ice.Override.Timeout=-1
nonRouterAdapter.Endpoints=tcp -p 10000
IceStormTopic.Proxy = UVSPIceStorm/TopicManager:default -p 9995
ValidationSvt.Proxy=ValidationSvt:tcp -h 127.0.0.1 -p 9997
Lobby.Proxy = Lobby:tcp -h 127.0.0.1 -p 9993
lgBridge.Proxy = lgBridge:tcp -p 10000
VerifyClient.Proxy=VerifyClient:tcp -p 10000
Ice.ACM.Client=0
Ice.MonitorConnections=0
Ice.RetryIntervals=-1
Ice.Warn.Connections=1
***************************************
Following is error C# code
*******************************************
public override int run(string[] args)
{
Ice.RouterPrx pdefaultRouter = communicator().getDefaultRouter();
if (pdefaultRouter == null)
{
return -1;
}
Glacier2.RouterPrx pGRouter = Glacier2.RouterPrxHelper.checkedCast(pdefaultRouter);
if (pGRouter == null)
{
return -1;
}
Glacier2.SessionPrx sp;
try
{
sp = pGRouter.createSession("name", "pwd");
}
catch (Glacier2.PermissionDeniedException ex)
{
}
catch (Glacier2.CannotCreateSessionException ex)
{
}
Ice.ObjectPrx pobj = null;
try
{
gRouterAdapter = communicator().createObjectAdapterWithRouter("GlobeRouterAdapter", pGRouter);
UVSP.UserManager.UserAgentPrx pUA = null;
Ice.ObjectPrx obj = communicator().propertyToProxy("ValidationSvt.Proxy");
UVSP.ValidationPrx ValiPrx = UVSP.ValidationPrxHelper.checkedCast(obj);
ValiPrx.Validate("leo", "pwd", out pUA);
gAdapter = communicator().createObjectAdapter("nonRouterAdapter");//what does it do?
ValiPrx.Validate("leo", "pwd", out pUA); //this occur error???
pobj = gAdapter.add(new ClgBridge(), communicator().stringToIdentity("lgBridge"));
pobj = gAdapter.add(ValidateClient.getValidClient(), communicator().stringToIdentity("VerifyClient"));
UVSPClient.CheckObjectPrx pCO = UVSPClient.CheckObjectPrxHelper.checkedCast(pobj);
gRouterAdapter.activate();
gAdapter.activate();
}
catch (Ice.Exception Ex) { }
communicator().waitForShutdown();
return 0;
}
******************************************
this Class inherit from Ice.Application.[/QUOTE]0 -
Hi Leo,
Its difficult to say exactly what is going wrong, especially when you don't provide the error output From a look at your configuration, you should not provide a definition for nonRouterAdapter.Endpoints. It you look at demo/Glacier2/callback/config.client for an example you'll find:
#
# We don't need any endpoints for the client if we use a
# router. Incoming requests are received through connections
# established from the client to the router.
#
Callback.Client.Endpoints=
If this doesn't help resolve your problem, please provide some more information, such as the exact error you get when running the application. The best way to get help is to provide a complete compilable example that demonstrates your issue. It also helps to know the version of Ice that you are using, your platform, and compiler.0