[EMA C++] How to recover the subscription of market data when the statusmsg returns a Closed stream

The connection to the EED server is ok. However,the OnStatusMsg method shows that the stream state for each market data item is closed and I attempt to recover the subscription of each item. The result of the attempt is that the stream state is also closed. But when I reopen my application mannually, the stream state is ok. Can you tell me how to recover the subscription of market data when the OnStatusMsg returns a Closed stream state and why a reconnection to the EED server can solve that problem?

My OnStatusMsg method is as below.

image

Best Answer

  • umer.nalla
    Answer ✓

    Hi @zhouzhengxin

    Can you confirm what value is reported for the StatusCode and StatusText? This may help understand the reason/cause of the close stream.

    In terms of programmatic recovery, how soon after the Closed do you try to re-request the item? And if so, how many times do you try before abandoning?

    It is usually good practice to wait a few seconds, before re-requesting and if making more than one retry attempt, wait a bit longer between each attempt - and then aborting the attempts after 2-3 attempts.

    Also, just to confirm, are you actually connecting direct to the Elektron Edge Server (EED) or are you connecting via TREP i.e. ADS server?