Tuesday, February 28, 2017

WebSocket Support for .NET Core

Full WebSocket support is coming with .NET Standard 2.0, which has now been delayed until Q3. In the meantime, there are still a few options to work with...

If you want to use Microsoft.AspNetCore.WebSockets.Server, I have added a middle ware wrapper that feel a lot more like Fleck:

public void Configure(IApplicationBuilder app)
{
    app.UseWebSockets();
    app.UseWebSocketHandler("test", connection =>
    {
        // Register your listeners here
        connection.OnMessage = m =>
        {
            if (m == "hi")
                connection.SendAsync("bye");
        };
    });
}

Enjoy,
Tom

5 comments:

  1. I think that you should avoid the second line boolean character as they can cause errors while interpreting You can also ask professional writers to get Phd thesis help in compiling the documentations

    ReplyDelete
  2. These programming languages like .Net, C++ and java are very common and also very useful for the individuals. The people who want to produce the content for Nursing Dissertation help can take help from the experts to produce the sites and websites which deliver such academic and informative content for everyone.

    ReplyDelete
  3. If u want to get loans,. stock for your business and company to grow , then must visit our website business loan leads

    ReplyDelete
  4. Discover our blockchain development services, where we harness the power of decentralized technology to create secure, transparent, and innovative solutions. From smart contracts to custom blockchain applications, our expertise enables us to build systems that redefine industries, ensuring data integrity, trust, and enhanced efficiency in today's rapidly evolving digital landscape.

    ReplyDelete
  5. Adidas NHS Discount offers a special NHS discount to healthcare workers as a token of appreciation for their dedication and hard work. This discount allows those in the National Health Service to enjoy savings on a wide range of Adidas products, including athletic apparel and footwear. It's a small way for Adidas to show support and gratitude for the healthcare community.

    ReplyDelete

Real Time Web Analytics