I have an SMTP listener that works well but is only able to receive one connection. My C# code is below and I am running it as a service. My goal is to have it runnign on a
As per your code, you are starting one listener and receiving and processing message and closing program.
You need to maintain a listener and TcpClient object can be passed to another function to process the message received. listener.Start();
Console.WriteLine("Awaiting connection...");
client = listener.AcceptTcpClient();
Console.WriteLine("Connection accepted!");