- add server protocol enum

pull/26/head
Simon G 6 years ago
parent b36dff749f
commit 59dc1722b1
  1. 33
      GBase.Server/ServerProtocol.cs

@ -0,0 +1,33 @@
// Author: Simon Gockner
// Created: 2020-02-08
// Copyright(c) 2020 SimonG. All Rights Reserved.
using System;
namespace GBase.Server
{
public enum ServerProtocol //TODO: Decide which protocols should be usable
{
Http,
Https,
Tcp
}
public static class ServerProtocolExtensions
{
public static string GetProtocolString(this ServerProtocol protocol)
{
switch (protocol)
{
case ServerProtocol.Http:
return "http://";
case ServerProtocol.Https:
return "https://";
case ServerProtocol.Tcp:
throw new NotImplementedException();
default:
throw new ArgumentOutOfRangeException(nameof(protocol), protocol, "Invalid Protocol");
}
}
}
}
Loading…
Cancel
Save