Jump to content
  • 0

Lightstreamer Connect fail on DEMO account


swingwin

Question

I can't connect to the DEMO stream ("https://demo-apd.marketdatasystems.com") since December 2021 with a C# .NET application using the IG API
On the other hand the connection to a LIVE stream ("https://apd.marketdatasystems.com") works

It seems that the problem comes from the "DotNetClient_N2.dll" library.
Has anyone encountered the same problem ?

 

Edited by swingwin
Link to comment

Recommended Posts

  • 0

Many thanks @Tartempion.
In any case it is not won with Windows 7.
Because I don't see how to introduce this new property and how to install the TLS12 protocol
I did some tests today on my C# application but without success.

Link to comment
  • 0

For .NET applications the problem is clearly located in the .NET Framework and the way the TLS1.2 protocol is set up in it
So it is certainly not a problem linked to the "DotNetClient_N2.dll" library
Indeed :
- I made a test with the java application using the java library "sdk.client.java.se-5.1.1.1623.2.jar" ==> no connection problem and the data arrive correctly with the stream
- I converted this java library to .NET assembly using IKVMC
- my C#.NET application now uses the "sdk.client.java.se-5.1.1.1623.2.dll" library for lightstreamer connections, instead of the "DotNetClient_N2.dll" library
and then the lightstream connection fails with the following error message

"com.lightstreamer.ls_client.PushConnException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake"

Link to comment
  • 0

You will need to install a fresh, clean copy of Windows 10 and then everything will work again.
Windows 10 has the underlying HTTPS SSL infrastructure needed for your code.
Other apps, like browsers, build their own HTTPS SSL infrastructure.
It is not possible to patch Windows 7, you are forced to upgrade or use a different code paradigm, like Java.
Note, installing Windows 10 over Windows 7 won't work as it keeps a lot of Windows 7 files, has to be a fresh, clean install of WIndows 10.

Link to comment
  • 0

For now, I solved my problem so I can stay with windows 7 and keep my C# application intact.

I developed a DDE server in Python interfacing with the IG APIs.
I converted the Python application into an executable to improve performance.
And I retrieve the DDE in C# (or Excel) with the NDde.dll assembly.

I'll leave it at that for now and wait to test fast feeds in times of high volatility
But if the performance is not there I'm considering doing the same thing with an RTD server and/or with Java.

Link to comment
  • 0

I have completed the performance tests in periods of high volatility (US opening for example).
The performances are excellent even if the solution found is a bit twisted.

So I stay on this technical solution which works perfectly with Windows 7 and .NET.
The solution is :
API stream received by a compiled python application, which delivers the data on the workstation with a DDE server.
Thus any application can connect to this DDE server and exploit the stream of the IG APIs (personal application with .NET, Excel, Matlab, etc...). No latency was observed.

Link to comment
  • 0

Has anyone used this Lightstreamer Haxe library in .NET version?
https://github.com/Lightstreamer/Lightstreamer-lib-client-haxe/tree/NET-v6.0.0-beta.2

Does it solve the problem mentioned in this thread?

The Haxe library is compatible with Lightstreamer Server since 7.3.2.
But is it the case for the LightStreamer IG server because IG still hasn't given the version used on their servers?
Sincerely

Link to comment
  • 0

I've tested it shortly with my project, but it's not running.

The problem with newer versions than 5.0.5 was, that the LS_CID has changed and was not accepted from server anymore. So I think that IG uses an older version of Lightstream Server. The LS_CID seems to be used to keep compatibility between client library and server.

Quote

LS_cid=jqWtj1twChtfDxikwp1ltvcC4BJ4KikvD578vy1sj.h67EK8MCb

Here my log:

Quote

serverAddress changed: https://demo-apd.marketdatasystems.com
event: nr:serverAddress.changed <m=100 du=20 nr=1400>
adapterSet changed: null
user changed: xxxxx
password changed
Connection requested: details: {serverAddress => https://demo-apd.marketdatasystems.com, user => xxxxx, libVersion => dotnet_standard_client 6.0.0-beta.2 build 20230405} options: {keepaliveInterval => 0, serverInstanceAddressIgnored => false, firstRetryMaxDelay => 100, contentLength => 50000000, sessionRecoveryTimeout => 15000, pollingInterval => 0, idleTimeout => 19000, slowingEnabled => false, requestedMaxBandwidth => BWUnlimited, stalledTimeout => 2000, reverseHeartbeatInterval => 0, HTTPExtraHeadersOnSessionCreationOnly => false, retryDelay => 4000, reconnectTimeout => 3000}
event: connect <m=100 du=20 nr=1400>
goto: <m=101 du=20 nr=1400>
goto: <m=101 du=20 nr=1410>
event: select.create <m=101 du=20 nr=1410>
Status: CONNECTING
WS connecting: wss://demo-apd.marketdatasystems.com/lightstreamer headers(null) proxy(null) certificateValidator(false)
goto: <m=120 du=20 nr=1410>
event: du:create <m=120 du=20 nr=1410>
goto: <m=120 du=21 nr=1410>
Subscription requested: subId: 1 {requestedSnapshot => SnpYes, mode => MERGE, items => [MARKET:IX.D.DAX.IFMM.IP], fields => [BID,OFFER]}
sub#subscribe(1) in <m=1>
sub#goto(1) <m=2>
event: send.control <m=120 du=21 nr=1410>
WS event: open
event: ws.open <m=120 du=21 nr=1410>
Sending session create: LS_user=xxxxx LS_cid=xxxxx LS_send_sync=false LS_cause=api
WS sending: wsok
WS sending: create_session
LS_user=xxxxx&LS_cid=xxxxx&LS_send_sync=false&LS_cause=api&LS_password=CST-xxxxx
goto: <m=121 du=21 nr=1410>
event: transport.timeout <m=121 du=21 nr=1410>
Websocket suspended
WS disposing
goto: <m=115 du=21 nr=1410>
event: du:retry <m=115 du=21 nr=1410>
Retrying connection. Cause: Websocket transport not available
goto: <m=115 du=23 nr=1410>
event: retry.timeout <m=115 du=23 nr=1410>
goto: <m=116 du=23 nr=1410>
event: select.create <m=116 du=23 nr=1410>
Sending session create: LS_polling=true LS_polling_millis=0 LS_idle_millis=0 LS_user=Z43B2S LS_cid=xxxxx LS_cause=ws.unavailable
HTTP sending: https://demo-apd.marketdatasystems.com/lightstreamer/create_session.txt?LS_protocol=TLCP-2.4.0 LS_polling=true&LS_polling_millis=0&LS_idle_millis=0&LS_user=xxxxx&LS_cid=xxxxx&LS_cause=ws.unavailable&LS_password=CST-xxxxx headers(null)
goto: <m=130 du=23 nr=1410>
event: du:create <m=130 du=23 nr=1410>
goto: <m=130 du=21 nr=1410>
HTTP event: text(CONERR,65,Unsupported protocol version: com.lightstreamer.b.b1@51dd3b73)
HTTP event: complete
event: CONERR <m=130 du=21 nr=1410>
CONERR 65 Unsupported protocol version: com.lightstreamer.b.b1@51dd3b73
HTTP disposing
Status: DISCONNECTED
goto: <m=100 du=21 nr=1410>
event: du:terminate <m=100 du=21 nr=1410>
Disconnected. Cause: 65 - Unsupported protocol version: com.lightstreamer.b.b1@51dd3b73
Transports enabled again.
goto: <m=100 du=20 nr=1410>
goto: <m=100 du=20 nr=1400>

 

Link to comment
  • 0
On 16/05/2022 at 05:03, mf2 said:

FWIW, the programming language does not really matter and you don’t need any special libraries to access the LightStreamer API. You can send standard HTTP requests and it works, as long as you stick to the protocol. Personally, I prefer this approach as this makes my program independent from any third-party libraries.

Regarding version 6.0, I meant that the LightStreamer API Companion adds `LS_client_version=6.0` to the request. Note that you don’t need any JavaScript client libraries to access the API via JavaScript, you could use AJAX and/or the .txt endpoint instead of the .js endpoint.

The issue is just that some details in the specification are left to speculation or interpretation, therefore it requires some experimenting. Furthermore, you need to make sure that you process Chunked requests properly if you don’t use polling.

Session V3 authentication can be used in your program, you just have to issue another Session V1 REST Api call afterwards to retrieve the CST and XST tokens, as you observed. Also, the documentation is here, you just need to scroll down to V3: https://labs.ig.com/rest-trading-api-reference/service-detail?id=600

(Note that IG calls this "oauth", but its really not)

So here is what I am doing:

  1. Authenticate with the REST api via a V3 session call
  2. Issue a V1 session call to get the XST and CST token
  3. Send the following HTTP POST request to the lightstreamer server, at `/lightstreamer/create_session.txt`:

"LS_cause=new.api&LS_polling=true&LS_polling_millis=0&LS_idle_millis=0&LS_client_version=6.0&LS_user=<IG Account ID>&LS_password=CST-<CST-Token>|XST-<XST-Token>&LS_container=lsc&"

Some notes:

  1. I use polling, which is not recommended, but its fine for my case.
  2. The `|` in the password needs to be escaped properly.

Hi Mf2, would you mind sharing part of your code that connects and handles the IG streaming connection? 🙂

 

Link to comment
  • 0

@SergioLage Interestingly, it seems that there is no proper way to post code in this forum – neither as a listing (no appropriate formatting) nor as an attachment (the filetype is not accepted).

So here is a very minimal C example, which gets you a working connection: http://0x0.st/H_rX.c

Note however, to subscribe to order status etc. you need to supply the other parameters like LS_user etc. which I wrote in my other post about.

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • image.png

  • Posts

    • As the Bitcoin halving event in April 2024 approaches, the cryptocurrency market is under intense scrutiny. The halving of miner rewards every four years not only regulates the supply of new bitcoins but also profoundly impacts market sentiment and supply-demand dynamics. This period will provide unique opportunities and challenges for the Qmiax exchange.   Halving events often increase the visibility of Bitcoin and typically lead to price and adoption rate increases, sparking widespread discussions about blockchain technology, Bitcoin network dynamics, and cryptocurrencies as a unique asset class. As an industry builder, Qmiax has prepared thoroughly for the upcoming halving event. The platform has not only strengthened its technical support to handle potential high transaction volumes but also provided educational resources and market analysis to help users better understand the halving event and its potential impact on the market.   History shows that although Bitcoin has seen price increases and expanded adoption rates in the months following halving, market reactions to each halving event have been different. The 2024 Bitcoin halving event presents unprecedented characteristics in several key aspects, requiring investors and market participants to remain vigilant and prepared for possible market fluctuations. Qmiax has strengthened its market analysis capabilities, providing real-time data and in-depth technical analysis to assist users in making well-informed decisions.   During this period, Qmiax has introduced a variety of new tools and services to support the trading needs of users in a high-volatility environment. These tools include enhanced risk management settings, more flexible trading options, and enhanced security measures to ensure the safety of the assets and transaction data of users.   In terms of education and support, Qmiax has launched a series of educational workshops and online courses on Bitcoin halving and its impact on the crypto market. These resources aim to enhance the market knowledge of users, enabling them to make wiser investment decisions during this critical period. Through these efforts, the platform has not only strengthened customer trust and satisfaction but also reinforced its position as a leader in market education.   The platform has enhanced its collaboration with other major cryptocurrency markets globally, ensuring consistent services and support worldwide. With this global perspective, Qmiax continues to demonstrate its influence and innovation in the cryptocurrency trading field.   With the Bitcoin halving event approaching, Qmiax is fully prepared to meet this market milestone. Through technological innovation, customer education, and global market cooperation, the platform not only supports the current market but also lays the foundation for future market changes. In the ever-evolving world of cryptocurrencies, Qmiax is committed to providing leading services and solutions, leading the industry forward.
    • Gold Elliott Wave Analysis  Function - Trend Mode - Impulse Structure - Impulse wave Position -Wave 4 Direction - Wave 5 Details -  Wave 4 has reached the extreme area and bounced off the 2300 MG1. We will expect wave 5 to progress higher. However, it’s still in the early stages. Invalidation below 2245.17. Gold has undergone a retracement since its peak on April 12th, following a remarkable surge to a fresh all-time high. Despite this pullback, the underlying bullish momentum remains robust and is anticipated to reassert itself once the corrective phase concludes. In today's analysis, we delve into the potential areas where Gold may discover the necessary support to propel its next upward movements.   Zooming into the daily chart, our Elliott Wave analysis commences with identifying an impulse wave sequence originating from the low at 1614, marking the termination of wave (IV) at the supercycle degree back in September 2022. Presently, the supercycle wave V is unfolding, currently navigating through the third leg of the cycle degree, denoted as wave III. Within this wave III, classified as an impulse wave, we find ourselves within the third sub-wave, indicated as blue wave '3' of primary degree, further delineated into wave (3) of intermediate degree. Within this intricate structure, the price action appears to be nearing the culmination of minor degree wave 4. Consequently, the impulse sequence characterizing the intermediate wave (3) has yet to finalize, let alone the overarching supercycle wave (V). Thus, Gold's bullish trajectory remains firmly intact, advocating for a strategic approach of buying into the dips within this robust trend. Presently, the price appears to be undergoing a dip corresponding to wave 4 of (3), with an anticipated subsequent uptrend in wave 5.    Transitioning to the H4 chart, our focus narrows on the completion of wave 4, manifesting as a zigzag pattern since the peak on April 12th. Conventionally, the termination of the third leg of a zigzag typically occurs at extensions ranging from 100% to 138.2% of the initial leg's length from the subsequent corrective move. However, an extension beyond 138.2%, particularly to 161.8%, tends to invalidate the zigzag pattern. In this context, we cautiously assert that the zigzag for wave 4 might have concluded, with a critical level of invalidation identified at 2245. Nonetheless, further confirmation is sought through the emergence of more bullish candle formations. Meanwhile, the target projection for wave 5 remains at 2500, aligning with the continuation of Gold's upward trajectory within the Elliott Wave framework. Technical Analyst : Sanmi Adeagbo Source : TradingLounge.com get trial here!        
    • Surprising US PMI drops contrast with Europe’s gains in services, pushing EUR/USD higher as markets recalibrate economic outlooks and monetary policy expectations.   Source: Getty   Forex Euro Pound sterling European Union Inflation EUR/USD Written by: Richard Snow | Analyst, DailyFX, Johannesburg   Publication date: Wednesday 24 April 2024 07:28 Flash PMI data provides unflattering US outlook, Europe improves German and EU manufacturing remains depressed but encouraging rises in flash services PMI results suggest improvement in Europe. UK manufacturing slumped well into contraction, but also benefitted from another rise on the services front. It was the US that provided the most surprising numbers, witnessing a decline in services PMI and a drop into contractionary territory for manufacturing – weighing on the dollar. EUR/USD rises after us PMI shock EUR/USD responded to lackluster flash PMI data in the US by clawing back recent losses. The euro attempts to surpass the 1.0700 level after recovering from oversold territory around the swing low of 1.0600. The pair has maintained the longer-term downtrend reflective of the diverging monetary policy stances adopted by the ECB and the Fed. A strong labour market, robust growth and resurgent inflation has forced the Fed to delay its plans to cut interest rates which has strengthened the dollar against G7 currencies. The surprising US PMI data suggests the economy may not be as strong as initially anticipated and some frailties may be creeping in. However, it will take a lot more than one flash data point to reverse the narrative. If bulls take control from here, 1.07645 becomes the next upside level of interest followed by 1.0800 where the 200 SMA resides. On the downside, 1.06437 and 1.0600 remain support levels of interest if the longer-term trend is to continue. EUR/USD daily chart     Source: TradingView EUR/GBP surrenders recent gains EUR/GBP rose uncharacteristically on Friday when risks of a broader conflict between Israel and Iran subsided. In addition, the Bank of England’s(BoE) Deputy Governor Dave Ramsden stated that he sees inflation falling sharply towards target in the coming months, sending a dovish signal to the market. Today the BoE’s chief Economist Huw Pill tried to walk back such sentiment, stressing that the bank needs to maintain restrictiveness in its policy stance. He did however, echo Ramsden’s remarks by saying the committee is seeing signs of a downward shift in the persistent component of the inflation dynamic. EUR/GBP appears to have found resistance around 0.8625 and has traded lower after the PMI data, even heading lower than the 200 SMA. A return to former channel resistance is potentially on the cards at 0.8578. Prices settled into the trading range as central bankers mulled incoming data and the prospect of a first rate cut appeared a fair distance away. Longer-term, the ECB is on track to cut rates in June, meaning sterling will extend its interest rate superiority and is likely to see the pair test familiar levels of support. EUR/GBP daily chart   Source: TradingView       This information has been prepared by IG, a trading name of IG Australia Pty Ltd. In addition to the disclaimer below, the material on this page does not contain a record of our trading prices, or an offer of, or solicitation for, a transaction in any financial instrument. IG accepts no responsibility for any use that may be made of these comments and for any consequences that result. No representation or warranty is given as to the accuracy or completeness of this information. Consequently any person acting on it does so entirely at their own risk. Any research provided does not have regard to the specific investment objectives, financial situation and needs of any specific person who may receive it. It has not been prepared in accordance with legal requirements designed to promote the independence of investment research and as such is considered to be a marketing communication. Although we are not specifically constrained from dealing ahead of our recommendations we do not seek to take advantage of them before they are provided to our clients.
×
×
  • Create New...
us