/// <summary> /// initialize simulation (will be initilized automatically when calling playto) /// </summary> virtual public void Initialize() { // setup the readers for (int i = 0; i < myhsi.TOC.GetLength(0); i++) { readers.Add(new tagged(i, Folder + myhsi.TOC[i, 0])); readers[readers.Count - 1].gotTick += new TickDelegate(HistSimIndexPlay_gotTick); hsip_avail += readers[readers.Count - 1].ApproxTicks; } debug("Initialized " + readers.Count + " files containing ~" + hsip_avail + " ticks."); int buffsize = (int)((double)hsip_avail / 10); _buf = new RingBuffer <Tick>(buffsize); hsipinited = true; if (myhsi.Playtimes.Length > 0) { hsip_nexttime = myhsi.Playtimes[0]; } }
public TLServer_IP(string ipaddr, int port, int wait, int TickBufferSize, DebugDelegate deb) { SendDebugEvent = deb; if (TickBufferSize == 0) { _queueb4send = false; } else { tickq = new RingBuffer <Tick>(TickBufferSize); } MinorVer = Util.ProgramBuild(Util.PROGRAM, debug); _wait = wait; if (!IPUtil.isValidAddress(ipaddr)) { debug("Not valid ip address: " + ipaddr + ", using localhost."); } _addr = IPUtil.isValidAddress(ipaddr) ? IPAddress.Parse(ipaddr) : IPAddress.Loopback; _port = port; v("tlserver_ip wait: " + _wait); Start(); }