private void killConnectionToolStripMenuItem_Click(object sender, EventArgs e) { lock (_reverseProxyHandler) { if (lstConnections.SelectedIndices.Count > 0) { //copy the list, it could happen that suddenly the items de-select int[] items = new int[lstConnections.SelectedIndices.Count]; lstConnections.SelectedIndices.CopyTo(items, 0); foreach (int index in items) { if (index < _openConnections.Length) { ReverseProxyClient connection = _openConnections[index]; connection?.Disconnect(); } } } } }
private void killConnectionToolStripMenuItem_Click(object sender, EventArgs e) { lock (SocksServer) { if (lstConnections.SelectedIndices.Count > 0) { int[] items = new int[lstConnections.SelectedIndices.Count]; lstConnections.SelectedIndices.CopyTo(items, 0); foreach (int index in items) { if (index < _openConnections.Length) { ReverseProxyClient connection = _openConnections[index]; if (connection != null) { connection.Disconnect(); } } } } } }
private void killConnectionToolStripMenuItem_Click(object sender, EventArgs e) { lock (SocksServer) { if (LvConnections.SelectedIndices.Count > 0) { //copy the list, it could happen the suddenly the items de-select int[] items = new int[LvConnections.SelectedIndices.Count]; LvConnections.SelectedIndices.CopyTo(items, 0); foreach (int index in items) { if (index < _openConnections.Length) { ReverseProxyClient connection = _openConnections[index]; if (connection != null) { connection.Disconnect(); } } } } } }
private void Execute(ISender client, ReverseProxyDisconnect message) { ReverseProxyClient socksClient = _socksServer.GetClientByConnectionId(message.ConnectionId); socksClient?.Disconnect(); }