Working fine in Console but not in Windows Form Program. Stuck in "Lseg.Stream.Open()"

Hi Team, BIS is asking for a solution on this code regading a migration from Eikon .NET to the new LSEG .NET Data Library.

Client says that data works in Console but not in Windows for PRogram. The code is stuck when runing: Lseg.Stream.Open().

"The program does is stuck both executing it directly or with the Visual Studio dubugger.

It is stuck at the statement “LsegStream.Open();”. This function call is synchronous.

The library has been installed via the Nugget package."

Client is using LSEG Workspace user as connection.

Code attached.

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @JuanSantanera

    Thank you for reaching out to us.

    I tested it with the following code and it runs fine.

    namespace LSEGDataWinForm
    {
    public partial class Form1 : Form
    {
    public ISession LsegSession { get; set; }
    public Form1()
    {
    InitializeComponent();
    }

    private async void button1_Click(object sender, EventArgs e)
    {
    var response = Pricing.Definition("EUR=", "CAD=", "USD=").Fields("DSPLY_NAME", "BID", "ASK")
    .GetStream();

    await response.OpenAsync();

    label1.Text = response["EUR="]["DSPLY_NAME"].ToString();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
    LsegSession = DesktopSession.Definition().GetSession();
    LsegSession.Open();

    }
    }
    }
    image.png