private void OnDisconnect() { if (Interlocked.CompareExchange(ref mClientDisconnected, 1, 0) == 0) { IWampConnectionMonitor monitor = Callee as IWampConnectionMonitor; monitor.ConnectionClosed -= OnClientDisconnect; mCatalog.Unregister(Callee, RegistrationId); mHandler.Unregistered(this); } }
public void Unregister(IWampCallee callee, long registrationId) { RemoteWampCalleeDetails operation = new RemoteWampCalleeDetails(callee, registrationId); if (!mOperationToDisposable.TryRemove(operation, out IDisposable disposable)) { throw new WampException(WampErrors.NoSuchRegistration, "registrationId: " + registrationId); } disposable.Dispose(); mInvocationHandler.Unregistered(operation); }