public void Close() { MustNotDisposed(); // TODO: move this to services layer if (Interlocked.CompareExchange( ref _addedToRouterState, (int)AddedToRouterState.Removed, (int)AddedToRouterState.Added) == (int)AddedToRouterState.Added) { _videoRouter.RemovePeerConnection(Device, this); } _peerConnectionImpl.Close(); }