1) The socket does not seem to be untied from LocalEndPoint until the process is complete.
2) I tried the solutions from another question, and also tried to wait a minute - to no avail.
3) At the moment, I tried the following to get rid of the socket and its connections:
public static void killUser(User victim)
{
LingerOption lo = new LingerOption(false, 0);
victim.connectedSocket.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.Linger, lo);
victim.connectedSocket.Shutdown(SocketShutdown.Both);
victim.connectedSocket.Disconnect(true);
victim.connectedSocket.Close();
clients.RemoveAt(victim.ID);
}
4) After a small number of searches, I canβt disconnect the port, so if I have enough connecting clients, in the end I will not have ports to listen to.
source
share