public partial class WinService: ServiceBase { private static TCPListen listener = null; public Winservice() { InitializeComponent(); } protected override void OnStart(String[] args) { loadconfig(); // Loading configuration data variables like port number IPAddress listener = new TcpListener(IPAddress, PortNumber); listener.Start(); AnotherClass handler = new AnotherClass(listener.AcceptTcpClient); Thread thd = new Thread(new ThreadStart(handler.HandleSession())); thd.Start(); } protected override void OnStop() { listener.Stop(); } public loadconfig() { Method implementation } }
TcpListener.AcceptTcpClient()
OnStart()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)