Trouble connecting using Real-Time SDK and C#
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
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
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
1.Initialize() in C:\Working\EDT\Refinitiv\Real-Time-SDK\CSharp\Ema\Src\Core\Access\OmmBaseImpl.cs:line 365
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
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
-
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>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).
0 -
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!
0
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.
- Do your company firewall or network policy block a TCP connection on port 14002?
- 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.
- Alternatively, you may configure the LoginRequestTimeOut parameter on the EmaConfig.xml file to adjust the API wait time for a Login Response message.
0 -
Hi, thank you for your suggestions.
- 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
- 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
orEU-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. - 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.
How would I go about troubleshooting this?
Best.
0 - Do your company firewall or network policy block a TCP connection on port 14002?
Categories
- All Categories
- 3 Polls
- 6 AHS
- 37 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 698 Datastream
- 1.5K DSS
- 633 Eikon COM
- 5.2K Eikon Data APIs
- 14 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 6 Trading API
- 2.9K Elektron
- 1.5K EMA
- 257 ETA
- 565 WebSocket API
- 40 FX Venues
- 16 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 283 Open PermID
- 47 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 24 RDMS
- 2.1K Refinitiv Data Platform
- 803 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 122 Open DACS
- 1.1K RFA
- 107 UPA
- 194 TREP Infrastructure
- 232 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 100 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛