Skip to content

Dotnet client async questions #2

@magkal

Description

@magkal

Hey,
I've been looking at the compiled source code for the dotnet client, and there are some potential pitfalls in async calls not beeing awaited, like the websocket connection is created through System.Net.WebSockets.ClientWebSocket and that is connecting to the lightstreamer server with a call to ConnectAsync method.
But the lightstreamer library is making that call inside a constructor which as not async and bad practice it would be more reasonable to be used like this:

var ws = new WebSocket();
await ws.ConnectAsync();

See ref:
https://github.com/Lightstreamer/Lightstreamer-lib-client-haxe/blob/main/src/platform/cs/com/lightstreamer/internal/WsClient.hx#L38C10-L38C22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions