public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) { lock (this.thisLock) { if (this.openCalled) { throw Fx.Exception.AsWarning(new InvalidOperationException(SRAmqp.AmqpInvalidReOpenOperation(this, this.State)), null); } this.openCalled = true; } MessagingClientEtwProvider.TraceClient <string>((string source) => { }, this.name); return(new AmqpObject.OpenAsyncResult(this, timeout, callback, state)); }
public void Open(TimeSpan timeout) { bool flag = false; lock (this.thisLock) { if (this.openCalled) { throw Fx.Exception.AsWarning(new InvalidOperationException(SRAmqp.AmqpInvalidReOpenOperation(this, this.State)), null); } this.openCalled = true; if (this.State == AmqpObjectState.OpenReceived) { flag = true; } } if (!flag) { this.OnOpen(timeout); return; } this.OpenInternal(); this.NotifyOpened(); }