SignalR Server in Tizen.Net Service application
By Devron Blatchford
03 Sep 2020 07:04
English
2 Replies
Hi, I've developed a .Net Service applicaiton and added a signalR hub. The service seems to work and start without errors. But when I try to connect from my wearable web app using the SignalR js client I get error "failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED"
I know server applications typically use messageport for comms, but i'm trying to port some signalR service logic and code to use as communication between my client and service.
Server Startup.cs
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseWebSockets();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapHub<WSHub>("/ws", options => options.Transports = Microsoft.AspNetCore.Http.Connections.HttpTransportType.WebSockets);
});
}
I've added these to my client config.xml
<access origin="h_ttp://127.0.0.1:5000" subdomains="false"></access>
<access origin="ws://127.0.0.1:5000" subdomains="false"></access>
connecting like this:
this.srConn = new signalR.HubConnectionBuilder()
.withUrl(`h_ttp://127.0.0.1:5000/ws`, { skipNegotiation: true, transport: signalR.HttpTransportType.WebSockets })
.withAutomaticReconnect()
.configureLogging(signalR.LogLevel.Information)
.build();
await this.srConn.start()
Is there somethig in the .Net manifest I need to declare to allow a tcp port maybe?
Anyone know if this should work? and if not, why not?
Cheers
Devron
Edited on 03 09, 2020
You must log in to use this service. Log in now?
The tag you entered already exists.
Do you want to report this post as spam?
The post has been reported as spam.
cannot be empty.
Are you sure you want to cancel and return to the list?
The code has been copied to the clipboard.
Enter a title.