private void Listner_MitmPairAccepting(object sender, T pair) { pair.Closing += Pair_Closing; pair.Closed += Pair_Closed; Accepting?.Invoke(this, pair); }
protected virtual void ProcessConnections(Connection client, Connection server) { try { var pair = MakePair(); ConfigurePair(pair); pair.Client.SetupConnection(client, false); pair.Server.SetupConnection(server, false); Accepting?.Invoke(this, pair); pair.Initialize(); pair.Client.Start(); pair.Server.Start(); Accepted?.Invoke(this, pair); } catch { ActiveFactory.Free(client); PassiveFactory.Free(server); } }