Languages

Menu
Sites
Language
SignalR Server in Tizen.Net Service application

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: truetransport: 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 by: Devron Blatchford on 02 Sep, 2020

Responses

2 Replies
Insoon Kim
I'm not sure about the server-side configuration in .net app.
But It requires the some permissions to use websocket in webapp side.
Kindly ensure you have enabled the following configurations for your app.
<tizen:privilege name="http://tizen.org/privilege/internet"/>
<access origin="*" subdomains="true"/>
AFAIK, Wearable device also requires the following feature.
Required feature: http://tizen.org/feature/network.internet
Seungkeun Lee

We need to check two things
1. To communicate through TCP/IP socket between apps, they should be packaged by one package (in this case hybrid app packaging)
2. I wonder how to migration ASP.net Core app to Tizen service app, It seems to be wrong, if you share all code of service app include procject files, I can help you