public void BeginCmd(string sCmd, SocketLineHandler lh) { if (bInUse) { new Exception("IQFeedPort " + portnumber.ToString() + " is in use with '" + sCmd + "'"); } else { this.lh = lh; bInUse = true; iqfport = this; this.sCmd = sCmd; //Monitor.Enter(qPortCmds); lock (qPortCmds.SyncRoot) { if (0 == qPortCmds.Count) { //Console.WriteLine("BeginCmd creating new socket"); bs = new BufferedSocket("127.0.0.1", portnumber, lh); bs.Open(); } else { //Console.WriteLine("BeginCmd regurgitating socket"); bs = qPortCmds.Dequeue() as BufferedSocket; bs.Add(lh); } } //Monitor.Exit(qPortCmds); bs.Send(sCmd); } }
public void IgnoreRemainingLines() { bs.Remove(lh); bs.Add(new SocketLineHandler(IgnoreRemainingLines)); }
public void IgnoreRemainingLines() { bs.Remove(lh); bs.Add(new Buffer.LineHandler(IgnoreRemainingLines)); }