{"record":{"id":"4efd64a259c7ca05","repo":"mgth/LittleBigMouse","slug":"the-samsung-display-closed-the-pairing-channel","errorCode":null,"errorMessage":"The Samsung display closed the pairing channel.","messagePattern":"The Samsung display closed the pairing channel\\.","errorType":"exception","errorClass":"WebSocketException","httpStatus":null,"severity":"error","filePath":"LittleBigMouse.Plugins/LittleBigMouse.Plugin.Vcp.Avalonia/SamsungTizen/SamsungTizenClient.cs","lineNumber":64,"sourceCode":"\n        try\n        {\n            await socket.ConnectAsync(SamsungTizenProtocol.RemoteUri(ipAddress, _token), cancellationToken)\n                .ConfigureAwait(false);\n\n            while (socket.State == WebSocketState.Open)\n            {\n                var message = await ReceiveTextLockedAsync(cancellationToken).ConfigureAwait(false);\n                var channelEvent = SamsungTizenProtocol.ParseChannelEvent(message);\n                if (!string.IsNullOrEmpty(channelEvent.Error))\n                    throw PairingException(channelEvent.Error);\n                if (!channelEvent.Connected) continue;\n\n                if (!string.IsNullOrWhiteSpace(channelEvent.Token)) _token = channelEvent.Token;\n                return;\n            }\n\n            throw new WebSocketException(\"The Samsung display closed the pairing channel.\");\n        }\n        catch (OperationCanceledException)\n        {\n            ResetSocketLocked();\n            throw;\n        }\n        catch (UnauthorizedAccessException)\n        {\n            ResetSocketLocked();\n            throw;\n        }\n        catch (Exception exception)\n            when (exception is WebSocketException or IOException or ObjectDisposedException)\n        {\n            var detail = InnermostMessage(exception);\n            ResetSocketLocked();\n            throw new InvalidOperationException(\n                $\"Could not open the Samsung remote-control channel on {ipAddress}: {detail}\",","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/mgth/LittleBigMouse/blob/7a42f01d47d99d223b8ee33ba4019af82adf1c48/LittleBigMouse.Plugins/LittleBigMouse.Plugin.Vcp.Avalonia/SamsungTizen/SamsungTizenClient.cs#L46-L82","documentation":"Thrown by SamsungTizenClient.EnsureConnectedLockedAsync when, after connecting the WebSocket to the display's remote URI, a channel event parsed from the server reports an error or fails to reach the connected state — the TV itself dropped or refused the pairing/control channel. It indicates the display side ended the handshake, typically because the token is no longer authorized or the user denied the pairing prompt.","triggerScenarios":"Thrown at LittleBigMouse.Plugins/LittleBigMouse.Plugin.Vcp.Avalonia/SamsungTizen/SamsungTizenClient.cs:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the Samsung pairing flow to obtain a fresh authorization token, then retry connecting.","Verify the TV's device-connection settings allow this client and that no pairing request is pending or was denied.","Check network reachability of the display and confirm no other client holds the exclusive remote-control session.","Call ReopenAsync to rebuild the socket after the display becomes available again."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a42f01d47d99d223b8ee33ba4019af82adf1c48","analyzedAt":"2026-09-16T00:35:00.514Z","contentChangedAt":"2026-09-16T00:35:00.514Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}