Trouble connecting using Real-Time SDK and C#

Options
tboonte
tboonte Newcomer
edited July 30 in EMA

I am unable to connect using RTSDK examples (Cons113 and Cons450).

I tried running examples with -clientId and -clientSecret arguments.

Copied over EmaConfig.xml and changed DefaultConsumer to Consumer_4.

Also updated code to use "Consumer_4"

public static void Main(string[] args)
{
OmmConsumer? consumer = null;
try
{
OmmConsumerConfig config = new();
if (!ReadCommandlineArgs(args, config))
return;
consumer = new (config.ConsumerName("Consumer_4"));
consumer.RegisterClient(new RequestMsg().ServiceName("ELEKTRON_DD").Name(itemName), new AppClient());
Thread.Sleep(900000); // API calls OnRefreshMsg(), OnUpdateMsg() and OnStatusMsg()
}
catch (OmmException ommException)
{
Console.WriteLine(ommException.Message);
}
finally
{
consumer?.Uninitialize();

}
}

Example 113, got error below

image.png

Then I tried Example 450, with -clientId and -clientSecret flags

I am able to get list of service endpoints, but I got the error below

image.png

Tried with or without proxy options but still unable to connect.

Below is exception stack trace

LSEG.Ema.Access.OmmInvalidUsageException
HResult=0x80131500
Message=login failed (timed out after waiting 45000 milliseconds) for us-east-1-aws-3-sm.optimized-pricing-api.refinitiv.net:14002)
Source=LSEG.Ema.Core
StackTrace:
at LSEG.Ema.Access.OmmBaseImpl1.HandleLoginReqTimeout() in C:\Working\EDT\Refinitiv\Real-Time-SDK\CSharp\Ema\Src\Core\Access\OmmBaseImpl.cs:line 892
at LSEG.Ema.Access.OmmConsumerImpl.HandleAdminDomains() in C:\Working\EDT\Refinitiv\Real-Time-SDK\CSharp\Ema\Src\Core\Access\OmmConsumerImpl.cs:line 277
at LSEG.Ema.Access.OmmBaseImpl
1.Initialize() in C:\Working\EDT\Refinitiv\Real-Time-SDK\CSharp\Ema\Src\Core\Access\OmmBaseImpl.cs:line 365
at LSEG.Ema.Access.OmmConsumer.Initialize() in C:\Working\EDT\Refinitiv\Real-Time-SDK\CSharp\Ema\Src\Core\Access\OmmConsumer.cs:line 93
at LSEG.Ema.Access.OmmConsumer..ctor(OmmConsumerConfig config) in C:\Working\EDT\Refinitiv\Real-Time-SDK\CSharp\Ema\Src\Core\Access\OmmConsumer.cs:line 105
at LSEG.Ema.Example.Traning.Consumer.Consumer.Main(String[] args) in C:\Working\EDT\Refinitiv\Real-Time-SDK\CSharp\Ema\Examples\Training\Consumer\400_Series\450_MP_QueryServiceDiscovery\Consumer.cs:line 348

This exception was originally thrown at this call stack:
LSEG.Ema.Access.OmmBaseImpl<T>.HandleLoginReqTimeout() in OmmBaseImpl.cs
LSEG.Ema.Access.OmmConsumerImpl.HandleAdminDomains() in OmmConsumerImpl.cs
LSEG.Ema.Access.OmmBaseImpl<T>.Initialize() in OmmBaseImpl.cs
LSEG.Ema.Access.OmmConsumer.Initialize() in OmmConsumer.cs
LSEG.Ema.Access.OmmConsumer.OmmConsumer(LSEG.Ema.Access.OmmConsumerConfig) in OmmConsumer.cs
LSEG.Ema.Example.Traning.Consumer.Consumer.Main(string[]) in Consumer.cs

What am I missing?

Thank you.

Best Answers

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @tboonte

    I did a quick test with RTSDK C# 2.3.0.L2 (the latest version - as of July 2025). The Cons113 example can connect to RTO us-east-1-aws-3-sm.optimized-pricing-api.refinitiv.net endpoint port 14002 successfully.

    EmaConfig.xml file:

    <Channel>
    <Name value="Channel_4"/>
    <ChannelType value="ChannelType::RSSL_ENCRYPTED"/>
    <CompressionType value="CompressionType::None"/>
    <GuaranteedOutputBuffers value="5000"/>
    <Host value="us-east-1-aws-3-sm.optimized-pricing-api.refinitiv.net"/>
    <Port value="14002"/>
    <EnableSessionManagement value="1"/>
    <EncryptedProtocolType value="EncryptedProtocolType::RSSL_SOCKET"/>
    </Channel>
    rto_connection.png

    Based on the given information and error:

    • You can connect to the us-east-1-aws-3-sm.optimized-pricing-api.refinitiv.net endpoint via a WebSocket connection (port 443) successfully
    • The EMA API can establish a connection to the RTO endpoint
    • The EMA API did send a Login request message to the RTO after a connection has been established
    • But somehow, the API could not get a Login Response message from RTO in time

    Like I said before, this is most likely a network issue that cause the message did not reach your end on time.

    To confirm my assumption, please enable the API log and trace message files, then share the files so we can verify activities between the API and server.

    You can enable the API trace messages with the XmlTraceToStdout value="1" on the EmaConfig.xml

    <Consumer>
    <Name value="Consumer_4"/>
    <ChannelSet value="Channel_4"/>
    <Logger value="Logger_1"/>
    <Dictionary value="Dictionary_1"/>
    <XmlTraceToStdout value="1"/>
    </Consumer>

    You can enable the API log with the Logger node on the EmaConfig.xml

    <Logger>
    <Name value="Logger_1"/>
    <!-- possible values: Stdout, File-->
    <LoggerType value="LoggerType::File"/>
    <LoggerSeverity value="LoggerSeverity::Verbose"/>
    </Logger>

    A log file will be available on RTSDK-folder\CSharp\Ema\Executables\Cons113\Debug\net<version> folder (If you are using a default path).

  • tboonte
    tboonte Newcomer
    Answer ✓

    You are absolutely correct, just got our network team involved and traced traffic.

    Our firewall did block it (it allows 443 but blocks others.)

    Issue resolved, thank you for your help.

    Cheers!

Answers

  • Hello @tboonte

    I found the following error message on the given logs:

    Message=login failed (timed out after waiting 45000 milliseconds) for us-east-1-aws-3-sm.optimized-pricing-api.refinitiv.net:14002)
    

    The error message means the API did send a Login request message to RTO us-east-1-aws-3-sm.optimized-pricing-api.refinitiv.net endpoint via the RSSL connection port 14002, but the API did not get a Login response message (either accept or reject) on time (45000 milliseconds === 45 seconds).

    This is most likely a network issue.

    1. Do your company firewall or network policy block a TCP connection on port 14002?
    2. If your organization already allows TCP connection port 14002, you may try to connect to the endpoint in the same region as your end such as AP-SOUTHEAST or EU-WEST regions.
    3. Alternatively, you may configure the LoginRequestTimeOut parameter on the EmaConfig.xml file to adjust the API wait time for a Login Response message.
    logintimeout.png
  • tboonte
    tboonte Newcomer

    Hi, thank you for your suggestions.

    1. Do your company firewall or network policy block a TCP connection on port 14002?
      I think we don't block outbound port, I tested connection and it's ok
      image.png
    2. If your organization already allows TCP connection port 14002, you may try to connect to the endpoint in the same region as your end such as AP-SOUTHEAST or EU-WEST regions.
      Tried change to ap-southeast and still received error "login failed (timed out after waiting 45000 milliseconds) for ap-southeast-1-aws-3-sm.optimized-pricing-api.refinitiv.net:14002)".
      I was able to use "us-east-1-aws-3-sm.optimized-pricing-api.refinitiv.net" with web socket without issue but unable to do so with EMA.
    3. Alternatively, you may configure the LoginRequestTimeOut parameter on the EmaConfig.xml file to adjust the API wait time for a Login Response message.
      Increased LoginRequestTimeOut to 60 seconds and still timeout.
      image.png

    How would I go about troubleshooting this?

    Best.