Skip to content
Shiny PlatformShiny Platform

Universal Hubs Release Notes

From 3.0, Shiny.BluetoothLE.Hubs is part of Universal Hubs. Its release notes up to 2.0.1 are on BluetoothLE Hubs Release Notes.

BREAKINGFeature
Universal Hubs is now the whole product: hubs over transports. Shiny.BluetoothLE.Hubs, .Host and .Client, and Shiny.UniversalHubs.Host and .Client, are replaced by Shiny.UniversalHubs (hubs, host, client, transport seams, wire protocols and the source generator) plus a package per transport: Shiny.UniversalHubs.BluetoothLE, Shiny.UniversalHubs.Http, Shiny.UniversalHubs.Multipeer and Shiny.UniversalHubs.Nearby. Everything is in the Shiny.UniversalHubs namespace. See Upgrading from BluetoothLE Hubs
BREAKINGFeature
Each hub is added by name and picks its transports: AddUniversalServer(s => s.AddHub<GameHub>("game", h => h.UseHttp(type).UseBluetoothLE(service, characteristic).UseMultipeer().UseNearby())). Hub rules are on the hub builder (MaxClients, ValidateClient, Serializer), and server-wide settings on Configure(o => ...) (UniversalServerOptions: LocalName, HostId, resume, file transfers, media channels, AuthorizeFile). AddBleHubServer is gone. Registration throws for a hub with no transport, a duplicate name, the same transport twice, a transport no hub uses, and BLE services that don’t fit in the advertisement
BREAKINGFeature
Clients register by hub name and pick their transports: AddUniversalHubClient<IGameHub>("game", o => o.UseHttp(type).UseBluetoothLE(service, characteristic)). Transports are tried in the order they’re added, or o.Priority<NearbyClientTransport, HttpClientTransport>(). AddBleHubClient is gone
BREAKINGFeature
Transports are classes identified by their type: IHubTransport on the host and IHubClientTransport on the client replace the HubTransports flags. Per connect, new HubConnectOptions("Allan").Prefer<T>(), .Allow<T>() and .Only<T>(); on the host, Start<T>(), Stop<T>(), StartHub<THub, T>(), StopHub<THub, T>(), IsRunning<T>() and RunningChanged. HubHostInfo.Transports lists client transport types, and host.Endpoint<BleHubEndpoint>() / host.IsSeenOver<T>() replace HubHostInfo.Ble, .Http, .Multipeer and .Nearby
Feature
Turn a client’s transports on and off while the app runs: client.Enable<T>(), Disable<T>(), Solo<T>(), IsEnabled<T>() and EnabledChanged. A disabled transport leaves running discoveries and is never connected over; disabling the one a connection is on disconnects it
Feature
Transports of your own: hub.UseTransport<T>(settings) on the host (settings read back with IHubBinding.GetSettings<T>()), server.AddTransport<T>() for dynamic-only servers, and o.UseTransport(sp => ...) on the client. See Custom Transports
BREAKINGFeature
HTTP no longer uses a Switchboard. Each hub connection is a WebSocket at {BasePath}/{hub name} carrying the same peer-link session as Multipeer and Nearby, with files and media channels in-band; the /files and /media routes are gone. Settings move to server.Http(o => ...) (HttpTransportOptions), and HubHostInfo.FromUrl becomes HttpHubHost.FromUrl(url, basePath). UniversalHubProtocol.Version is 3. See HTTP
Enhancement
HTTP clients resume a dropped WebSocket on a new one the same way Multipeer, Nearby and BLE clients do, under UniversalServerOptions.ResumeWindow, with Reconnecting while they’re away
BREAKINGFeature
Each BLE hub picks its own GATT service: UseBluetoothLE(serviceUuid, characteristicUuid, advertise). Hubs may share a service or have their own. 16-bit and 32-bit UUIDs ("180D") are accepted and expand onto the Bluetooth base UUID, taking 2 or 4 bytes of the advertisement. Registration throws when the advertised services don’t fit in 31 bytes, advertise: false keeps a hub’s service out of the advertisement, and a client’s scanFor: finds such a hub through another service. The one-service-per-host ServiceUuid settings are gone. See Bluetooth LE
BREAKINGFeature
Each hub can have its own serializer: hub.Serializer(...) on the host, o.Serializer(...) on the client. IHubSerializer has a Name that travels in the handshake, and a hub refuses a client whose serializer has another name. Values travel as the serializer wrote them on every transport, HTTP included, so non-JSON serializers work over HTTP now. Dynamic hubs are JSON
BREAKINGFeature
Dynamic hubs are keyed by name and pick their transports: new DynamicHubDefinition("trivia").UseHttp(type).UseBluetoothLE(characteristic). Each transport decides whether it serves one (IDynamicHubTransport): BLE only when given a characteristic, HTTP with its defaults either way, Multipeer and Nearby always. The allowed mDNS types move to HttpTransportOptions.DynamicServiceTypes, and the BLE service to BluetoothLETransportOptions.DynamicServiceUuid. Clients use dynamicClients.Create("trivia", o => o.UseHttp(type)). Handler hubs (AllowHandlerHubs, IBleHubHandler) are replaced by them. See Dynamic Hubs
BREAKINGEnhancement
Renamed: [BleHubClient] → [UniversalHubContract]; BleHub<T> merged into UniversalHub<T>; IBleHubClient<T> → IUniversalHubClient<T> (base IHubProxy<T>); IBleHubConnection → IHubConnection; IBleHubSerializer → IHubSerializer; BleHubException → HubException; BleHubRemoteException → HubRemoteException; BleHubDisconnectedException → HubDisconnectedException; IBleHubMediaChannel → IHubMediaChannel; BleHubClientStatus → HubClientStatus; BleHubProtocolOptions → HubProtocolOptions; BleHubConnectedClient → HubConnectedClient; IBleHubFileHandler → IBleFileHandler. The OnDisconnectedAsync(string? reason) overload is gone
BREAKINGEnhancement
A hub reads its client’s link through transport extensions: connection.Peripheral() (BLE), connection.HttpContext() (the WebSocket’s request: user, headers), connection.MultipeerPeer() and connection.NearbyPeer(), or connection.Get<T>(). connection.Transport is BleHostTransport says how a client is connected. HTTP connection ids are ws:{id}
BREAKINGEnhancement
Generator diagnostics are renamed from SBH001-SBH006 to SUH001-SUH006. See Contracts
Enhancement
New generator diagnostics for contracts that produced a proxy that didn’t compile: SUH007 (a property or indexer on a contract), SUH008 (a generic contract) and SUH009 (a member named like one of the proxy’s own, or a method and an event with the same name). Array, pointer, dynamic and type-parameter return types now report SUH002 instead of failing the generator. See Contracts
Enhancement
IHubEndpoint.StartStream for custom transports: send the stream’s items, its end, then Disconnect when the hub called Context.Abort(), as after an Invoke reply. Stream still works. See Custom Transports
Enhancement
HttpClientTransportOptions.MaxMessageSize (4 MB): the largest WebSocket message an HTTP client takes from a host. See HTTP
Fix
Two clients calling hub methods that push to each other over HTTP, Multipeer or Nearby could deadlock the host. Hub code no longer runs under the peer link’s lock
Fix
A contracts library and a host app with a hub over its contract no longer both generate the push extensions (CS0121 ambiguous call)
Fix
A BLE client that went away while OnConnectedAsync was running stayed registered, and its device was refused (“Connection id is already in use”) until the hub stopped
Fix
Context.Abort() in a streaming method disconnects after the stream’s end, so the client sees the stream complete. It also disconnects when the stream fails or is cancelled after the abort. A client keeps a reply or stream end that arrived just before a disconnect
Fix
Connecting a client that is already connected throws without dropping the live connection. A connect interrupted by the app’s own Disconnect() throws HubDisconnectedException, and a link closing as the handshake reply arrives can no longer leave the client Connected with no connection
Fix
Host lifecycle: a BLE client reconnecting while its old connection’s OnDisconnectedAsync ran lost its groups; a client that left during OnConnectedAsync is refused and never raises ClientConnected; MaxClients holds under concurrent handshakes; a resume onto a session that closed is cleaned up; a malformed goodbye still closes the session
Fix
Limits against a misbehaving peer: HTTP file frames need an upload the host allows (AllowUploads, after the handshake, within MaxUploadSize, 16 at a time); Nearby messages and unfinished files are capped; incoming media packets are bounded (the oldest dropped) and oversized ones dropped
Fix
Nearby: a cancelled connect hangs up, a file send fails when its device goes instead of hanging, received files are copied off the Android main thread and temp files are deleted, and starting or stopping a hub no longer briefly refuses sessions
Fix
Smaller fixes: a Cancel right behind its call over BLE is no longer lost; resume attempts that time out close their sessions; Transport names the transport carrying the connection after a failed attempt; pushes from a previous connection finish before the next connection’s start; the HTTP client sends a WebSocket close frame; a cancelled HTTP upload tells the host
Enhancement
Fewer allocations per push (lookups by id and group instead of scanning every client) and per HTTP message received
BREAKINGChore
New wire versions: FrameCodec.ProtocolVersion 2 (BLE), PeerProtocol.Version 2 (HTTP, Multipeer, Nearby) and UniversalHubProtocol.Version 3 (HTTP route and mDNS TXT keys). Advertisements list hub names. 3.0 doesn’t talk to 2.x; the handshake refuses a mismatch
Chore
Requires Shiny 7.2.0 and Shiny.Net.HttpServer 3.2.0
Feature
Multipeer, Nearby and BLE connections resume after a dropped link, as Wi-Fi already did. The host holds a dropped client for BleHubHostOptions.ResumeWindow (30 seconds, set in AddUniversalServer(server => server.Ble(o => ...))), keeping its connection id, groups and Properties and the pushes it misses. The client opens a new session (invites the Multipeer peer again, reconnects over Nearby or BLE), resumes as the same connection and gets the missed pushes; its Status is Reconnecting meanwhile. UniversalHubClientOptions.AutomaticReconnect now covers every transport. Wire compatible with 2.0 (PeerProtocol.Version stays 1). See Dropped links and resume
Chore
Requires Shiny.BluetoothLE.Hubs 2.0.1
BREAKINGChore
Built on .NET 11, Shiny 7 and Shiny.Net.HttpServer 3: every package targets net11.0 (and its -android, -ios, -maccatalyst and -macos builds), on Shiny 7.0.0 and Shiny.Net.HttpServer 3.0.0. Apps must target .NET 11 (MAUI 11) and move their Shiny and Shiny.Net.HttpServer packages to those versions. Wire compatible with 1.5
Chore
Requires Shiny.BluetoothLE.Hubs 2.0

Initial Release. Shiny.UniversalHubs and Shiny.BluetoothLE.Hubs now ship from one repo with one version, so the first release follows BluetoothLE Hubs’ 1.4 as 1.5.

Feature
Media channels over Wi-Fi: a WebSocket at {Endpoint}/media, opened with the mediaToken from the handshake reply and handed to the hub like an L2CAP media channel. Wire compatible: the reply’s new fields are optional
Chore
Requires Shiny.BluetoothLE.Hubs 1.4 (media channels)
FeatureiOS
New Shiny.UniversalHubs.Multipeer package: hubs are also served and joined over Apple’s MultipeerConnectivity (iOS, Mac Catalyst, macOS), so Apple devices reach each other at Wi-Fi speed with no shared network. server.Multipeer("mygame-mc") on the host, o.Multipeer("mygame-mc") on the client. Clients share the hub, groups and MaxClients with BLE and Wi-Fi clients; files, media channels and renames work over it
Feature
HubTransports.Multipeer, included in HubTransports.All. It only runs once the Multipeer package is set up and is skipped quietly where MultipeerConnectivity doesn’t exist, so one registration works in a cross-platform app. HubHostInfo.Multipeer, HubConnection.Multipeer and mc: connection ids say when a host or client is on it
FeatureAndroid
New Shiny.UniversalHubs.Nearby package: hubs are also served and joined over Google’s Nearby Connections (Android with Google Play services, iOS, macOS), so Android phones reach each other with no shared network, and Android and Apple devices on the same Wi-Fi. server.Nearby("com.mycompany.mygame") on the host, o.Nearby("com.mycompany.mygame") on the client, one service id per app. Every hub session is a channel inside one Nearby connection per pair of devices, so two hubs on one host, or two devices visiting each other, share it. Files, media channels and renames work over it. See Nearby
Feature
HubTransports.Nearby, included in HubTransports.All and skipped where Nearby Connections doesn’t exist. HubHostInfo.Nearby, HubConnection.Nearby (NearbyPeer) and nb: connection ids say when a host or client is on it. A hub client can use Multipeer and Nearby side by side
Enhancement
HubConnectOptions.Prefer is tried first, then Wi-Fi, Multipeer, Nearby and BLE in that order
Fix
Connecting to a host that restarted (it listens on a new port) no longer fails until the client app restarts. When none of a discovered host’s addresses answer, the client looks it up again by name over mDNS and retries where it is now. UniversalHubClientOptions.HttpRediscoverTimeout (3 seconds) sets how long it looks
Feature
Dynamic hubs: hubs defined while the app runs, by a downloaded web app or a script, served over BLE, Wi-Fi and Multipeer beside the compiled ones. AddUniversalServer(server => server.AllowDynamicHubs(o => o.ServiceTypes.Add("_myapp._tcp"))) fixes the service types they may use and how many there may be (DynamicHubOptions.MaxHubs, 6), and a server may start with no compiled hubs. IDynamicHubs.Add(new DynamicHubDefinition(name, characteristicUuid, serviceType), handler) returns an IDynamicHub to start, stop, push to (DynamicHubPush.Send) and group like a compiled one. An IDynamicHubHandler answers methods by name, with values as the caller serialized them. They share one Switchboard at {Endpoint}/{hub} with no protocol change. A hub added while the GATT service is up rebuilds it when it first starts, and the other hubs’ BLE clients are asked to reconnect then. With dynamic hubs on, a tunnel reaches only hubs that allow it. See Dynamic Hubs
Feature
Dynamic hub clients: join a hub with no compiled contract. services.AddDynamicHubClients(o => …) registers IDynamicHubClients, whose Create(characteristicUuid, mdnsServiceType) returns an IUniversalHubClient<IDynamicHubCalls> that discovers and connects like any client. IDynamicHubCalls has Invoke(method, args), Stream(method, args) and a Pushed(name, args) event, with values as serialized bytes (JSON with the default serializer). It works against compiled and dynamic hubs. See Dynamic Hub Clients
Enhancement
An error a hub relays keeps its type: throwing a BleHubRemoteException from a hub method sends the caller its RemoteErrorType rather than the exception’s class name, over Wi-Fi and Multipeer as over BLE