protected override void OnOpened() { base.OnOpened(); StreamSecurityUpgradeProvider security = this.Upgrade as StreamSecurityUpgradeProvider; if (security != null) { this.identity = security.Identity; } }
public static FramingConnectionDuplexSession CreateSession(FramingDuplexSessionChannel channel, StreamUpgradeProvider upgrade) { StreamSecurityUpgradeProvider security = upgrade as StreamSecurityUpgradeProvider; if (security == null) { return(new FramingConnectionDuplexSession(channel)); } throw ExceptionHelper.PlatformNotSupported("SecureConnectionDuplexSession is not supported."); }
public static FramingConnectionDuplexSession CreateSession(FramingDuplexSessionChannel channel, StreamUpgradeProvider upgrade) { StreamSecurityUpgradeProvider security = upgrade as StreamSecurityUpgradeProvider; if (security == null) { return(new FramingConnectionDuplexSession(channel)); } else { return(new SecureConnectionDuplexSession(channel)); } }