From 59dc1722b10bb3ff05585bbd82ce3b32d6d2d8aa Mon Sep 17 00:00:00 2001 From: Simon G Date: Sat, 8 Feb 2020 22:12:27 +0100 Subject: [PATCH] - add server protocol enum --- GBase.Server/ServerProtocol.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 GBase.Server/ServerProtocol.cs diff --git a/GBase.Server/ServerProtocol.cs b/GBase.Server/ServerProtocol.cs new file mode 100644 index 0000000..9c30b26 --- /dev/null +++ b/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"); + } + } + } +} \ No newline at end of file