Skip to content

Instantly share code, notes, and snippets.

@halter73
Last active January 31, 2017 01:25
Show Gist options
  • Save halter73/a7d2d79efcd542f00078c252aa42ed98 to your computer and use it in GitHub Desktop.
Save halter73/a7d2d79efcd542f00078c252aa42ed98 to your computer and use it in GitHub Desktop.
interface ITransportFactory
{
ITransport Create(ListenOptions, IConnectionHandler);
}
interface ITransport
{
// Can only be called once per ITransport
Task BindAsync();
Task UnbindAsync();
Task StopAsync();
}
interface IConnectionInformation
{
IPEndPoint RemoteEndPoint { get; }
IPEndPoint LocalEndPoint { get; }
}
// Implementd by Kestrel
interface IConnectionHandler
{
IConnectionContext OnConnection(IConnectionInformation);
}
interface IConnectionContext
{
string ConnectionId { get; }
IPipelineWriter InputPipeline { get; }
IPipelineReader OutputPipeline { get; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment