SignalRConnectionStandard by Roberto Camara

<PackageReference Include="SignalRConnectionStandard" Version="1.0.0" />

.NET API 9,216 bytes



Legend

  •  Assembly
  •  Namespace
  •  Class
  •  Interface or Abstract Class
  •  Static Class
  •  Struct
  •  Enum
  •  Delegate
  •  Grayed out == non-public

 SignalRConnectionStandard 1.0.0

Encapsula a criação de conexões e chamada aos métodos de um serviço SignalR. Ex.: SignalRCreateConnection exemploHub = new SignalRCreateConnection("http://localhost:8082/signalr", "ExampleHub"); SignalRCreateConnection notificationHub = new SignalRCreateConnection(host, "NotificationHub"); 1- "Invocando um método no server SignalR" Task&lt;string&gt; date = exemploHub.Invoke&lt;string&gt;("GetDateTimeFormated"); Console.WriteLine(date.Result); 2- Registrando-se para um evento notificationHub.On&lt;string&gt;("getNewGuid", d =&gt; { Console.WriteLine(d); }); 3- Verificar disponibilidade do serviço if(notificationHub.ServerOnline) { Console.WriteLine("Serviço OnLine");

<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>SignalRConnectionStandard</id>
    <version>1.0.0</version>
    <title>SignalRConnectionStandard</title>
    <authors>Roberto Camara</authors>
    <owners>Roberto Camara</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <projectUrl>https://github.com/RobertoCamara/UtilsSignalR</projectUrl>
    <description>Encapsula a criação de conexões e chamada aos métodos de um serviço SignalR.
Ex.: SignalRCreateConnection exemploHub = new SignalRCreateConnection("http://localhost:8082/signalr", "ExampleHub");
  SignalRCreateConnection notificationHub = new SignalRCreateConnection(host, "NotificationHub");

1- "Invocando um método no server SignalR"
Task&amp;lt;string&amp;gt; date = exemploHub.Invoke&amp;lt;string&amp;gt;("GetDateTimeFormated");
Console.WriteLine(date.Result);

2- Registrando-se para um evento
notificationHub.On&amp;lt;string&amp;gt;("getNewGuid", d =&amp;gt;
{
 Console.WriteLine(d);
});

3- Verificar disponibilidade do serviço
if(notificationHub.ServerOnline)
{
Console.WriteLine("Serviço OnLine");</description>
    <summary>Encapsula a criação de conexões e chamada aos métodos de um serviço SignalR.</summary>
    <language></language>
    <tags>signalr signalr-client self-hosted topshelf simpleinjector ioc log4net signalr-core windows-service dependency-injection standard roberto-camara</tags>
    <dependencies>
      <group targetFramework=".NETStandard2.0">
        <dependency id="Microsoft.AspNet.SignalR.Client" version="2.4.1" />
      </group>
    </dependencies>
  </metadata>
</package>