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; }
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; }
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()); } }
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); }
public FixCodecProxy(LocalClient client) { this.Instance = new FixCodecRaw(client); this.Handle = this.Instance.Constructor(); }
internal FixCodecProxy(LocalClient client, LPtr handle) { this.Instance = new FixCodecRaw(client); this.Handle = handle; }
public LocalChannelsPoolProxy(LocalClient client, LrpServer.Net.LrpParams parameters) { this.Instance = new LocalChannelsPoolRaw(client); this.Handle = this.Instance.Constructor(parameters); }
internal LocalChannelsPoolProxy(LocalClient client, LPtr handle) { this.Instance = new LocalChannelsPoolRaw(client); this.Handle = handle; }
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); }
internal LocalServerProxy(LocalClient client, LPtr handle) { this.Instance = new LocalServerRaw(client); this.Handle = handle; }
public FinCalcProxy(LocalClient client, string text) { this.Instance = new FinCalcRaw(client); this.Handle = this.Instance.Constructor(text); }