ppy/osu · error · NotImplementedException

Binary message type not supported.

Error message

Binary message type not supported.

What it means

Thrown as NotImplementedException by WebSocketNotificationsClient when a WebSocket frame arrives with type Binary. The client only understands text (JSON) notification frames; binary frames indicate either a server bug or a protocol mismatch.

Source

Thrown at osu.Game/Online/Notifications/WebSocket/WebSocketNotificationsClient.cs:74

                            {
                                SocketMessage? message = JsonConvert.DeserializeObject<SocketMessage>(messageResult.ToString());
                                messageResult.Clear();

                                Debug.Assert(message != null);

                                if (message.Error != null)
                                {
                                    Logger.Log($"{GetType().ReadableName()} error: {message.Error}", LoggingTarget.Network);
                                    break;
                                }

                                MessageReceived?.Invoke(message);
                            }

                            break;

                        case WebSocketMessageType.Binary:
                            throw new NotImplementedException("Binary message type not supported.");

                        case WebSocketMessageType.Close:
                            throw new WebException("Connection closed by remote host.");
                    }
                }
                catch (Exception ex)
                {
                    await InvokeClosed(ex).ConfigureAwait(false);
                    return;
                }
            }
        }, cancellationToken);

        private async Task closeAsync()
        {
            try
            {
                await socket.CloseAsync(WebSocketCloseStatus.NormalClosure, @"Disconnecting", CancellationToken.None).ConfigureAwait(false);

View on GitHub (pinned to d9c73e12ad)

Solutions

  1. Confirm the server is the expected version and only sends text frames.
  2. If binary is legitimately possible, handle it before the throw (parse or log and continue) instead of treating it as fatal.
  3. Catch the exception at the connection-closed handler to trigger a reconnect rather than killing notifications permanently.

Example fix

// before
case WebSocketMessageType.Binary:
    throw new NotImplementedException("Binary message type not supported.");

// after
case WebSocketMessageType.Binary:
    Logger.Log("Ignored unsupported binary notification frame.", LoggingTarget.Network);
    break;
Defensive patterns

Strategy: try-catch

Validate before calling

// before receiving, there is no per-frame type to validate; the guard is in the receive loop.

Try / catch

// the existing loop already catches and calls InvokeClosed(ex);
// ensure a reconnect strategy is attached to the Closed event.

Prevention

When it happens

Trigger: The notifications WebSocket server sends a message whose WebSocketMessageType is Binary rather than Text. The receive loop has no handler for binary and throws.

Common situations: Server-side change to the notifications protocol; connecting to a non-conforming or wrong-version server; a proxy that re-frames messages as binary.

Related errors


AI-assisted analysis of ppy/osu@d9c73e12ad (2026-08-13). Data as JSON: /api/errors/248c32bc95e185f9. Report an issue: GitHub.