Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / TransportContext.cs / 1305376 / TransportContext.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Net.Security; using System.Security.Authentication.ExtendedProtection; namespace System.Net { public abstract class TransportContext { public abstract ChannelBinding GetChannelBinding(ChannelBindingKind kind); } internal class ConnectStreamContext : TransportContext { internal ConnectStreamContext(ConnectStream connectStream) { GlobalLog.Assert(connectStream != null, "ConnectStreamContext..ctor(): Not expecting a null connectStream!"); this.connectStream = connectStream; } public override ChannelBinding GetChannelBinding(ChannelBindingKind kind) { return connectStream.GetChannelBinding(kind); } private ConnectStream connectStream; } internal class SslStreamContext : TransportContext { internal SslStreamContext(SslStream sslStream) { GlobalLog.Assert(sslStream != null, "SslStreamContext..ctor(): Not expecting a null sslStream!"); this.sslStream = sslStream; } public override ChannelBinding GetChannelBinding(ChannelBindingKind kind) { return sslStream.GetChannelBinding(kind); } private SslStream sslStream; } internal class HttpListenerRequestContext : TransportContext { internal HttpListenerRequestContext(HttpListenerRequest request) { GlobalLog.Assert(request != null, "HttpListenerRequestContext..ctor(): Not expecting a null request!"); this.request = request; } public override ChannelBinding GetChannelBinding(ChannelBindingKind kind) { if (kind != ChannelBindingKind.Endpoint) { throw new NotSupportedException(SR.GetString( SR.net_listener_invalid_cbt_type, kind.ToString())); } return request.GetChannelBinding(); } private HttpListenerRequest request; } // Holds a cached Endpoint binding to be reused by HttpWebRequest preauthentication internal class CachedTransportContext : TransportContext { internal CachedTransportContext(ChannelBinding binding) { this.binding = binding; } public override ChannelBinding GetChannelBinding(ChannelBindingKind kind) { if (kind != ChannelBindingKind.Endpoint) return null; return binding; } private ChannelBinding binding; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Msec.cs
- Enum.cs
- _SafeNetHandles.cs
- KeyValueConfigurationElement.cs
- TrustSection.cs
- RenderingBiasValidation.cs
- CommandCollectionEditor.cs
- SqlConnectionPoolProviderInfo.cs
- ActiveXContainer.cs
- SerializeAbsoluteContext.cs
- MessagingDescriptionAttribute.cs
- TextEditor.cs
- DesignerDataConnection.cs
- RoutedPropertyChangedEventArgs.cs
- TypeLibConverter.cs
- PageTheme.cs
- TypeContext.cs
- ObjectDataSourceEventArgs.cs
- TextTreeTextElementNode.cs
- Simplifier.cs
- TrackingProfileDeserializationException.cs
- UnsignedPublishLicense.cs
- Hash.cs
- BindingNavigator.cs
- GlyphShapingProperties.cs
- AssemblyCache.cs
- DataGridViewMethods.cs
- sitestring.cs
- WebPartEditorOkVerb.cs
- FacetChecker.cs
- RadioButtonAutomationPeer.cs
- DataRecordInternal.cs
- SystemDiagnosticsSection.cs
- TableParagraph.cs
- WindowsTokenRoleProvider.cs
- DBDataPermission.cs
- CommandConverter.cs
- elementinformation.cs
- MetadataLocation.cs
- assertwrapper.cs
- CommonObjectSecurity.cs
- DataProtection.cs
- XmlArrayItemAttribute.cs
- CodeCompiler.cs
- COM2PictureConverter.cs
- HttpFormatExtensions.cs
- SmiGettersStream.cs
- SecurityTokenParametersEnumerable.cs
- BaseProcessor.cs
- NativeMethods.cs
- RequestSecurityTokenResponse.cs
- MatrixAnimationBase.cs
- DynamicDiscoveryDocument.cs
- TextCollapsingProperties.cs
- FontStretchConverter.cs
- HttpFileCollection.cs
- TemplateControl.cs
- DataGridToolTip.cs
- CounterSampleCalculator.cs
- InfoCardService.cs
- SessionStateModule.cs
- XmlCharCheckingWriter.cs
- IntSecurity.cs
- ActivityDesignerResources.cs
- LOSFormatter.cs
- XmlSignatureManifest.cs
- StaticFileHandler.cs
- StateItem.cs
- OutputCacheModule.cs
- X509Certificate2.cs
- OleDbFactory.cs
- TabControl.cs
- StreamingContext.cs
- FastEncoderWindow.cs
- WSSecurityPolicy.cs
- Compiler.cs
- AsyncResult.cs
- InheritanceService.cs
- SerialStream.cs
- SqlBuffer.cs
- ResourceManager.cs
- IApplicationTrustManager.cs
- OrthographicCamera.cs
- RowToFieldTransformer.cs
- SqlParameterizer.cs
- FixedSOMContainer.cs
- FormViewInsertEventArgs.cs
- ButtonBaseAdapter.cs
- ConfigurationSection.cs
- DataGridRowEventArgs.cs
- EntityCommandDefinition.cs
- ExceptionRoutedEventArgs.cs
- NetStream.cs
- SessionConnectionReader.cs
- SessionStateContainer.cs
- IconEditor.cs
- PassportIdentity.cs
- ArcSegment.cs
- ValidationHelper.cs
- XmlHierarchyData.cs