Giter Site home page Giter Site logo

killnine / hubconnectionmanager Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 12.71 MB

SignalR extension to help retry connecting to server if initialization fails on startup. Also provides more convenient unit testing interface.

C# 97.68% Shell 2.32%

hubconnectionmanager's People

Contributors

jamiehumphries avatar killnine avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

martonboda

hubconnectionmanager's Issues

Resubscribing to groups

Looking for input on what happens after a disconnect (not just connection interruption, but after the DisconnectTimeout period ends and the client disconnects).

According to ASP.NET documentation, all Group subscriptions are lost after a disconnect. Just looking for input on what the best course of action should be on the part of the HubConnectionManager after this happens.

Should it facilitate re-subscribing to those groups after connection is re-established?

Currently, I am doing this manually on the client by subscribing to the StateChanged event and calling a method on the Hub that subscribes again to the appropriate groups.

SignalR.Server closes unexpectedly on restart

When running SignalR.Server and SignalR.Client together for testing, it seems like the server will run fine for a while, but if I restart the server to test the Client's ability to reconnect, the Server will unexpectedly shut down after a short period.

Not sure if I am fat-fingering a key and causing it to close, or something is being disposed prematurely and causing the application to crash.

Client Disconnect (by choice!)

As of 1.0.2, the Manager will always try and reconnect any time that it detects the Closed event. Probably need to prevent this. Users may want to eventually disconnect ;)

Extension Method for converting an OAuth access token to a cookie, then adding it to the Hub Connection

Not sure how helpful this is/will be:

    public static class HubConnectionExtensions {
        public async static void WithOAuthToken(this HubConnection connection, Uri authUri, string accessToken) {
            var cookies = new CookieContainer();
            var clientHandler = new System.Net.Http.HttpClientHandler { 
                UseCookies = true, 
                CookieContainer = cookies 
            };
            var client = new HttpClient(clientHandler) {
                BaseAddress = new Uri(connection.Url)
            };
            client.SetBearerToken(accessToken);
            var result = await client.GetAsync(authUri);
            result.EnsureSuccessStatusCode();

            connection.CookieContainer = cookies;
        }
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.