I connecting to real-time project by SSE instead of WebSockets

I have ASP.NET Core 2.1 real-time (signalr) web application & .NET Framework client. I made simple detecting, what transport type uses in connection.
Client-side:
MessageBox.Show($“Client Listener: {ClientHandlerConnection.State} [{await ClientHandlerConnection.InvokeAsync(“GetTransportType”)}]\nReport Listener: {ReportHandleConnection.State} [{await ReportHandleConnection.InvokeAsync(“GetTransportType”)}]\nBotNet System: -”);

GetTransportType on server-side:
public string GetTransportType()
{
return Context.Features.Get().TransportType.ToString();
}

When i testing connection on windows localhost, GetTransportType returns [WebSockets]
Wnen i testing connection on Glitch, GetTransportType returns [ServerSentEvents]

SSE works bad, after a while client can’t receive data from server. I really need websocket connection, but i don’t know how to configure it. Help please.

Moving this to #coding-help.

Formatting code:

MessageBox.Show($“Client Listener: {ClientHandlerConnection.State} [{await ClientHandlerConnection.InvokeAsync(“GetTransportType”)}]\nReport Listener: {ReportHandleConnection.State} [{await ReportHandleConnection.InvokeAsync(“GetTransportType”)}]\nBotNet System: -”);

GetTransportType on server-side:
public string GetTransportType()
{
return Context.Features.Get().TransportType.ToString();
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.