本文整理汇总了C#中Ice.InitializationData类的典型用法代码示例。如果您正苦于以下问题:C# InitializationData类的具体用法?C# InitializationData怎么用?C# InitializationData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InitializationData类属于Ice命名空间,在下文中一共展示了InitializationData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static int Main(string[] args)
{
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties(ref args);
App app = new App();
return app.main(args, initData);
}
示例2: initData
public override Ice.InitializationData initData()
{
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties();
initData.properties.setProperty("Ice.Warn.Connections", "0");
return initData;
}
示例3: Main
public static int Main(string[] args)
{
int status = 0;
Ice.Communicator communicator = null;
Debug.Listeners.Add(new ConsoleTraceListener());
try
{
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties(ref args);
initData.properties.setProperty("Ice.Default.Host", "127.0.0.1");
communicator = Ice.Util.initialize(ref args, initData);
status = run(args, communicator);
}
catch(Exception ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
if(communicator != null)
{
try
{
communicator.destroy();
}
catch(Ice.LocalException ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
}
return status;
}
示例4: Main
public static int Main(string[] args)
{
int status = 0;
try
{
Console.Out.Write("testing load properties from UTF-8 path... ");
Console.Out.Flush();
Ice.InitializationData id = new Ice.InitializationData();
id.properties = Ice.Util.createProperties();
id.properties.load("./config/中国_client.config");
test(id.properties.getProperty("Ice.Trace.Network").Equals("1"));
test(id.properties.getProperty("Ice.Trace.Protocol").Equals("1"));
test(id.properties.getProperty("Config.Path").Equals("./config/中国_client.config"));
test(id.properties.getProperty("Ice.ProgramName").Equals("PropertiesClient"));
Console.Out.WriteLine("ok");
Console.Out.Write("testing load properties from UTF-8 path using Ice::Application... ");
Console.Out.Flush();
PropertiesClient c = new PropertiesClient();
c.main(args, "./config/中国_client.config");
Console.Out.WriteLine("ok");
}
catch(System.Exception ex)
{
System.Console.Error.WriteLine(ex);
status = 1;
}
return status;
}
示例5: Main
public static int Main(string[] args)
{
int status = 0;
Ice.Communicator communicator = null;
try
{
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties(ref args);
communicator = Ice.Util.initialize(ref args, initData);
status = run(args, communicator);
}
catch(Exception ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
if(communicator != null)
{
try
{
communicator.destroy();
}
catch(Ice.LocalException ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
}
return status;
}
示例6: Main
public static int Main(string[] args)
{
int status = 0;
Ice.Communicator communicator = null;
try
{
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties(ref args);
//
// For this test, we want to disable retries.
//
initData.properties.setProperty("Ice.RetryIntervals", "-1");
//
// This test kills connections, so we don't want warnings.
//
initData.properties.setProperty("Ice.Warn.Connections", "0");
initData.properties.setProperty("Ice.MessageSizeMax", "50000");
// This test relies on filling the TCP send/recv buffer, so
// we rely on a fixed value for these buffers.
initData.properties.setProperty("Ice.TCP.SndSize", "50000");
//
// Setup the test transport plug-in.
//
string defaultProtocol = initData.properties.getPropertyWithDefault("Ice.Default.Protocol", "tcp");
initData.properties.setProperty("Ice.Default.Protocol", "test-" + defaultProtocol);
communicator = Ice.Util.initialize(ref args, initData);
PluginI plugin = new PluginI(communicator);
plugin.initialize();
communicator.getPluginManager().addPlugin("Test", plugin);
status = run(args, communicator);
}
catch(System.Exception ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
if(communicator != null)
{
try
{
communicator.destroy();
}
catch(Ice.LocalException ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
}
return status;
}
示例7: TempCommunicator
public TempCommunicator(string configFileClasspath)
{
log("Constructor called");
try
{
InitializationData initData = new InitializationData();
initData.properties = Util.createProperties();
initData.properties.load(configFileClasspath);
communicator = Util.initialize(initData);
log("Properties Loaded!");
}
catch (Exception e)
{
log(e.ToString());
throw e;
}
string proxy1 = "'::TeRK::TeRKUser':tcp -h 127.0.0.1 -p 10101";
log("Calling stringToProxy on " + proxy1);
communicator.stringToProxy(proxy1);
log("Complete!");
string proxy2 = "'::TeRK::TeRKUser':tcp -h 192.168.0.16 -p 10101";
log("Calling stringToProxy on " + proxy2);
communicator.stringToProxy(proxy2);
log("Complete!");
log("Constructor terminated");
writeLog("C:\\tempCommLog.txt");
}
示例8: createClientProps
createClientProps(Ice.Properties defaultProperties, string defaultDir, string defaultHost)
{
Ice.InitializationData result = new Ice.InitializationData();
result.properties = Ice.Util.createProperties();
//
// TODO:
//
// When an application loads IceSSL.dll directly, as this one does, we
// must ensure that it uses the same DLL as the one loaded dynamically
// by Ice.
//
// When Mono supports .NET 2.0, we'll need to fix this.
//
result.properties.setProperty("Ice.Plugin.IceSSL", "IceSSL:IceSSL.PluginFactory");
if(defaultProperties.getProperty("Ice.IPv6").Length > 0)
{
result.properties.setProperty("Ice.IPv6", defaultProperties.getProperty("Ice.IPv6"));
}
result.properties.setProperty("Ice.RetryIntervals", "-1");
if(defaultHost.Length > 0)
{
result.properties.setProperty("Ice.Default.Host", defaultHost);
}
if(defaultDir.Length > 0)
{
result.properties.setProperty("IceSSL.DefaultDir", defaultDir);
}
//result.properties.setProperty("IceSSL.Trace.Security", "1");
return result;
}
示例9: Main
public static int Main(string[] args)
{
int status = 0;
Ice.Communicator communicator = null;
try
{
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties(ref args);
initData.properties.setProperty("Ice.ThreadPool.Server.ThreadPriority", "AboveNormal");
communicator = Ice.Util.initialize(ref args, initData);
status = run(args, communicator);
}
catch(System.Exception ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
if(communicator != null)
{
try
{
communicator.destroy();
}
catch(Ice.LocalException ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
}
return status;
}
示例10: Main
public static int Main(string[] args)
{
int status = 0;
Ice.Communicator communicator = null;
try
{
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties();
initData.properties.setProperty("Ice.Warn.Dispatch", "0");
initData.properties.setProperty("Ice.MessageSizeMax", "10"); // 10KB max
communicator = Ice.Util.initialize(ref args, initData);
status = run(args, communicator);
}
catch(Exception ex)
{
Console.WriteLine(ex);
status = 1;
}
if(communicator != null)
{
try
{
communicator.destroy();
}
catch(Ice.LocalException ex)
{
Console.WriteLine(ex);
status = 1;
}
}
return status;
}
示例11: Main
public static int Main(string[] args)
{
#if !COMPACT
Debug.Listeners.Add(new ConsoleTraceListener());
#endif
//
// We must disable connection warnings, because we attempt to
// ping the router before session establishment, as well as
// after session destruction. Both will cause a
// ConnectionLostException.
//
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties(ref args);
initData.properties.setProperty("Ice.Warn.Connections", "0");
#if COMPACT
//
// When using Ice for .NET Compact Framework, we need to specify
// the assembly so that Ice can locate classes and exceptions.
//
initData.properties.setProperty("Ice.FactoryAssemblies", "client");
#endif
App app = new App();
return app.main(args, initData);
}
示例12: Main
public static int Main(string[] args)
{
int status = 0;
Ice.Communicator ic = null;
try
{
Ice.InitializationData data = new Ice.InitializationData();
#if COMPACT
//
// When using Ice for .NET Compact Framework, we need to specify
// the assembly so that Ice can locate classes and exceptions.
//
data.properties = Ice.Util.createProperties();
data.properties.setProperty("Ice.FactoryAssemblies", "client,version=1.0.0.0");
#endif
//
// Create a communicator
//
ic = Ice.Util.initialize(ref args, data);
//
// Create a proxy for the root directory
//
Ice.ObjectPrx obj = ic.stringToProxy("RootDir:default -h localhost -p 10000");
//
// Down-cast the proxy to a Directory proxy
//
DirectoryPrx rootDir = DirectoryPrxHelper.checkedCast(obj);
if(rootDir == null)
{
throw new ApplicationException("Invalid proxy");
}
//
// Recursively list the contents of the root directory
//
Console.WriteLine("Contents of root directory:");
listRecursive(rootDir, 0);
}
catch(Exception e)
{
Console.Error.WriteLine(e);
status = 1;
}
if(ic != null)
{
try
{
ic.destroy();
}
catch(Exception e)
{
Console.Error.WriteLine(e);
status = 1;
}
}
return status;
}
示例13: Main
public static int Main(string[] args)
{
int status = 0;
Ice.Communicator communicator = null;
#if !COMPACT
Debug.Listeners.Add(new ConsoleTraceListener());
#endif
try
{
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties(ref args);
//
// For this test, we want to disable retries.
//
initData.properties.setProperty("Ice.RetryIntervals", "-1");
//
// This test kills connections, so we don't want warnings.
//
initData.properties.setProperty("Ice.Warn.Connections", "0");
//
// Setup the test transport plug-in.
//
string defaultProtocol = initData.properties.getPropertyWithDefault("Ice.Default.Protocol", "tcp");
initData.properties.setProperty("Ice.Default.Protocol", "test-" + defaultProtocol);
communicator = Ice.Util.initialize(ref args, initData);
PluginI plugin = new PluginI(communicator);
plugin.initialize();
communicator.getPluginManager().addPlugin("Test", plugin);
status = run(args, communicator);
}
catch(System.Exception ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
if(communicator != null)
{
try
{
communicator.destroy();
}
catch(Ice.LocalException ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
}
return status;
}
示例14: ServerManagerI
internal ServerManagerI(ServerLocatorRegistry registry,
Ice.InitializationData initData)
{
_registry = registry;
_communicators = new ArrayList();
_initData = initData;
_initData.properties.setProperty("TestAdapter.AdapterId", "TestAdapter");
_initData.properties.setProperty("TestAdapter.ReplicaGroupId", "ReplicatedAdapter");
_initData.properties.setProperty("TestAdapter2.AdapterId", "TestAdapter2");
}
示例15: Main
public static int Main(string[] args)
{
int status = 0;
Ice.Communicator communicator = null;
#if !COMPACT
Debug.Listeners.Add(new ConsoleTraceListener());
#endif
try
{
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties(ref args);
initData.properties.setProperty("Ice.Package.Test", "test.Ice.metrics");
initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010");
initData.properties.setProperty("Ice.Admin.Endpoints", "tcp");
initData.properties.setProperty("Ice.Admin.InstanceName", "client");
initData.properties.setProperty("Ice.Admin.DelayCreation", "1");
initData.properties.setProperty("Ice.Warn.Connections", "0");
initData.properties.setProperty("Ice.Warn.Dispatch", "0");
initData.properties.setProperty("Ice.MessageSizeMax", "50000");
initData.properties.setProperty("Ice.Default.Host", "127.0.0.1");
#if COMPACT
//
// When using Ice for .NET Compact Framework, we need to specify
// the assembly so that Ice can locate classes and exceptions.
//
initData.properties.setProperty("Ice.FactoryAssemblies", "collocated");
#endif
initData.observer = _observer;
communicator = Ice.Util.initialize(ref args, initData);
status = run(args, communicator);
}
catch(System.Exception ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
if(communicator != null)
{
try
{
communicator.destroy();
}
catch(Ice.LocalException ex)
{
Console.Error.WriteLine(ex);
status = 1;
}
}
return status;
}