Giter Club home page Giter Club logo

bedrocktransports's Introduction

Bedrock Transports

Project Bedrock is a set of APIs .NET Core for doing transport agnostic networking. In .NET Core 3.0 we've introduced some new abstractions as part of the Microsoft.AspNetCore.Connections.Abstractions for client-server communication.

Server API

public interface IConnectionListenerFactory
{
    ValueTask<IConnectionListener> BindAsync(EndPoint endpoint, CancellationToken cancellationToken = default);
}

public interface IConnectionListener : IAsyncDisposable
{
    EndPoint EndPoint { get; }
    ValueTask<ConnectionContext> AcceptAsync(CancellationToken cancellationToken = default);
    ValueTask UnbindAsync(CancellationToken cancellationToken = default);
}

Client API

public interface IConnectionFactory
{
    ValueTask<ConnectionContext> ConnectAsync(EndPoint endpoint, CancellationToken cancellationToken = default);
}

Why?

The goal of this project is to abstract the networking stack from the application layer so that protocols could be written agnostic of the underlying transport. This enables new transports (like QUIC) to be adopted without changing the code written against the abstraction. The design also allows reaching into the abstraction to pull out transport specific features where that is needed.

Consumers:

  • Kestrel is built on top of these APIs (this is the new Kestrel transport layer)
  • SignalR is built on top of these APIs (.NET client and server)
  • Orleans just recently adopted these abstractions

A sample of a couple bedrock transports using new APIs added in .NET Core 3.0

  • Pipes - A named pipes transport based on NamedPipeClientStream and NamedPipeServerStream
  • Http2 - An HTTP/2 based transport that uses turns each request into a duplex connection using HTTP/2 streams. Uses Kestrel on the server and HttpClient on the client
  • WebSockets - A WebSockets transport (uses Kestrel and the building blocks of SignalR internally).
  • AzureSignalR - A transport that uses AzureSignalR as a low level connection proxy. It implements the Azure SignalR Service protocol in order to do the connection multiplexing.

bedrocktransports's People

Contributors

davidfowl avatar ruikuan avatar

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.