Announcement

Collapse
No announcement yet.

ESignal hangs during stream RequestSymbol

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ESignal hangs during stream RequestSymbol

    Hi,

    I use ESignal 10.1a and try to access realTimeQuotes from my C# program.
    I use Interop.IESignal.dll (60kb) to do that.

    esignal = new IESignal.HooksClass();
    esignal.OnQuoteChanged += new IESignal._IHooksEvents_OnQuoteChangedEventHandler( esignal_OnQuoteChanged);

    I call requestSymbol once for each of two symbols.
    However after receiving two streams of data for about 5 seconds application hangs and doesn't respond.

    public static void requestSymbol(String symbol)
    {
    try
    { getESignal().RequestSymbol(symbol, 0);
    }
    catch (Exception e)
    {
    log.Error("RequestSymbol error", e);
    esignal = null; getESignal().RequestSymbol(symbol, 0);
    }
    }

    public static void esignal_OnQuoteChanged(String symbol)
    {
    long currentTime = DateTime.Now.Ticks;
    if (!symbolTimes.ContainsKey(symbol) || currentTime - symbolTimes[symbol] > feedInterval)
    {
    if (!symbolTimes.ContainsKey(symbol)) symbolTimes.Add(symbol, currentTime);
    else symbolTimes[symbol] = currentTime;
    }
    else
    {
    log.Debug(symbol + " is out of feedInterval; time = " + currentTime);
    }
    log.Debug("Sending symbol = " + symbol);
    IESignal.BasicQuote bq = getESignal().get_GetBasicQuote(symbol);
    }

    feedInterval = 0.5 sec or 1 second
    Btw where can I get the latest version of Interop.IESignal.dll. It seems that my version is far out of date.

  • #2
    Since you instantiate the esignal object as "esignal", your requests should look like this:

    esignal.RequestSymbol(symbol, 0);
    esignal.get_GetBasicQuote(symbol);

    Comment


    • #3
      Thank you for a suggestion
      getEsignal() actually returns eSignal so it's not a problem here.

      I found the problem.

      The thing was that log4net which is used for logging doesn't support multi-threaded applications transparently and it hanged during multiple simultaneous attempts to write to log.

      Comment

      Working...
      X