We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I bet CreateClientWebSocket returns a WebSocket because both Managed.ClientWebSocket and ClientWebSocket inherits from WebSocket.
WebSocket
Managed.ClientWebSocket
ClientWebSocket
The problem is that it hides the Options property. If I want to set the KeepAliveInterval should I do something like this?
Options
KeepAliveInterval
var client = SystemClientWebSocket.CreateClientWebSocket(); if (client is System.Net.WebSockets.Managed.ClientWebSocket managed) { managed.Options.KeepAliveInterval = TimeSpan.FromSeconds(0); await managed.ConnectAsync(uri, cancellationToken); } else { var coreSocket = client as ClientWebSocket; coreSocket.Options.KeepAliveInterval = TimeSpan.FromSeconds(0); await coreSocket.ConnectAsync(uri, cancellationToken); }
If think one option would be passing the Options as an argument to the ConnectAsync method.
ConnectAsync
The text was updated successfully, but these errors were encountered:
Alternatively, a helper function in the form of SystemClientWebSocket.SetKeepAliveInterval(WebSocket ws, TimeSpan interval) would be helpful too...
Sorry, something went wrong.
No branches or pull requests
I bet CreateClientWebSocket returns a
WebSocket
because bothManaged.ClientWebSocket
andClientWebSocket
inherits fromWebSocket
.The problem is that it hides the
Options
property. If I want to set theKeepAliveInterval
should I do something like this?If think one option would be passing the
Options
as an argument to theConnectAsync
method.The text was updated successfully, but these errors were encountered: