Beispiel #1
0
 static Native()
 {
     var path = LrpLibrary.Path;
     var client = new LocalClient(path, LocalCpp.Signature.Value, Mode.InProcess);
     LocalCpp.Library proxy = new LocalCpp.Library(client);
     proxy.SetDotNetDllPath(typeof(Native).Assembly.Location);
     Native.Client = client;
 }
Beispiel #2
0
 static LocalClient CreateLocalClient(string filename, string signature)
 {
     var path = Library.Path;
     path = Path.Combine(path, filename);
     path += Library.Platform;
     path += ".dll";
     var client = new LocalClient(path, signature);
     return client;
 }
Beispiel #3
0
		static void Main(string[] args)
		{
			try
			{
				TimeSpan interval = new TimeSpan(0, 0, 1);
				using (LocalClient client = new LocalClient("LocalCppServer.dll", Signature.Value, Mode.OutProcess))
				{
					SimpleTest(client);
					//ExtendedTest(client);
					//SpeedTest(client);
					//PInvokeSpeedTest();
				}
			}
			catch (System.Exception ex)
			{
				Console.WriteLine(ex.ToString());
			}
		}
Beispiel #4
0
		private static void SpeedTest(LocalClient client)
		{
			Extended extended = new Extended(client);

			DateTime start = DateTime.UtcNow;
			Int32 count = 16 * 1024 * 1024;
			for (Int32 index = 0; index < count; ++index)
			{
				Double amount = 0;
				Double volume = 100000;
				extended.MarketBuy("EUR/USD", 1.3, ref volume, out amount);
			}
			DateTime finish = DateTime.UtcNow;
			Double interval = (finish - start).TotalSeconds;
			Double speed = (count / interval);
			Console.WriteLine("LRP speed");
			Console.WriteLine("Interval = {0}", interval);
			Console.WriteLine("Speed = {0}", speed / 1000);
		}
Beispiel #5
0
		public FixCodecProxy(LocalClient client)
		{
			this.Instance = new FixCodecRaw(client);
			this.Handle = this.Instance.Constructor();
		}
Beispiel #6
0
		internal FixCodecProxy(LocalClient client, LPtr handle)
		{
			this.Instance = new FixCodecRaw(client);
			this.Handle = handle;
		}
Beispiel #7
0
		public LocalChannelsPoolProxy(LocalClient client, LrpServer.Net.LrpParams parameters)
		{
			this.Instance = new LocalChannelsPoolRaw(client);
			this.Handle = this.Instance.Constructor(parameters);
		}
Beispiel #8
0
		internal LocalChannelsPoolProxy(LocalClient client, LPtr handle)
		{
			this.Instance = new LocalChannelsPoolRaw(client);
			this.Handle = handle;
		}
Beispiel #9
0
		public LocalServerProxy(LocalClient client, SoftFX.Lrp.LPtr channels, int port, string sertificateFilename, string sertificatePassword, SoftFX.Lrp.LPtr handler)
		{
			this.Instance = new LocalServerRaw(client);
			this.Handle = this.Instance.Constructor(channels, port, sertificateFilename, sertificatePassword, handler);
		}
Beispiel #10
0
		internal LocalServerProxy(LocalClient client, LPtr handle)
		{
			this.Instance = new LocalServerRaw(client);
			this.Handle = handle;
		}
Beispiel #11
0
		public FinCalcProxy(LocalClient client, string text)
		{
			this.Instance = new FinCalcRaw(client);
			this.Handle = this.Instance.Constructor(text);
		}