Recently, when I use my TCP / IP server and client, I noticed that both of them remain open in Processes after they are closed.
I found that the Client remains open by deleting the socket on the server, which closes all asynchronous threads in the background of my structure.
However, when I try to do this with the server, no matter what I do, the process remains open.
ACCEPTING that the TCP / IP server processes its own things, is there anything else in this code to keep the process open?
EDIT: UPDATE: If I put a breakpoint after the line Application.Run (new ServerForm ()) in Program.cs, it will break as soon as I click on exit or call Application.Exit ().
I do not know that this terminates the program, but does not exit Main.
namespace ChatServer { public partial class ServerForm : Form { private NetLib.Server _server = new NetLib.Server(); public delegate void ClientConnection(ServerNetworkState ns); public ServerForm() { InitializeComponent(); } private void ServerForm_Load(object sender, EventArgs e) {
}
source share