public override void SetConnectionListeners(List <IConnectionListener> listeners) { base.SetConnectionListeners(listeners); // If the connection is already alive we assume that the new listeners want to be notified if (Connection != null) { ConnectionListener.OnCreate(Connection); } }
public override IConnection CreateConnection() { lock (_connectionMonitor) { if (Connection == null) { var target = DoCreateConnection(); Connection = new SharedConnectionProxy(this, target); // invoke the listener *after* this.connection is assigned ConnectionListener.OnCreate(target); } } return(Connection); }