Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodiAppProtocolRegistry.RemoveProtocol

function RemoveProtocol(const aProtocol: iAppProtocol): Boolean;
Unregisters the exact INSTANCE and answers whether it was present. BY INSTANCE, NOT BY TOKEN, deliberately: nothing forbids two registrations sharing a token, and a token lookup takes the first match - so a component asking to leave could evict a SIBLING's registration and leave its own behind, dangling once the component is freed. The instance is the registration key, exactly as TstCustomSSHServer.Remove keys the peer list by transport. The Token is an ALPN matter: it is what the handshake selects BY (FindProtocol/ResolveProtocol), not what a registrant IS. Also drops the instance from FallbackProtocol, which is a second strong reference the list removal would otherwise leave behind. The Boolean result is what lets a caller re-seat only what was actually registered.