public void startClient(IPostOfficeProtocol _driver) { driver = _driver; Thread clientThread = new Thread(doPostOfficeProtocol); clientThread.Start(); }
private static IPostOfficeProtocol getDriver(TcpClient clientSocket, string driverType) { config = new Config(); switch (driverType.ToLower()) { case "aws": config.Settings.Add("awskey", Environment.GetEnvironmentVariable("awskey")); config.Settings.Add("awssecret", Environment.GetEnvironmentVariable("awssecret")); config.Settings.Add("bucket", Environment.GetEnvironmentVariable("bucket")); config.Settings.Add("prefix", Environment.GetEnvironmentVariable("prefix")); mailStore = new AwsSESImpl(clientSocket, config); break; case "filesystem": config.Settings.Add("emailFolder", Environment.GetEnvironmentVariable("email_folder")); mailStore = new FileSystemImpl(clientSocket, config); break; default: throw new Exception("unsupported mail store"); } return(mailStore); }