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

3 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

Real Time Web Analytics