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
- BackStopAuthenticationModule.cs
- HttpWebRequest.cs
- RectangleF.cs
- PrintPreviewControl.cs
- TcpChannelFactory.cs
- assemblycache.cs
- RegexRunnerFactory.cs
- SubpageParagraph.cs
- WebPartActionVerb.cs
- Assembly.cs
- BmpBitmapDecoder.cs
- CodeMemberEvent.cs
- FileDialogCustomPlacesCollection.cs
- PropertyItem.cs
- WebPartZoneCollection.cs
- FrameworkElementFactoryMarkupObject.cs
- Baml6ConstructorInfo.cs
- WebPartsPersonalizationAuthorization.cs
- DynamicControlParameter.cs
- PerfCounterSection.cs
- ContainerUtilities.cs
- ElasticEase.cs
- Container.cs
- StatusBarPanelClickEvent.cs
- ClusterRegistryConfigurationProvider.cs
- PathSegment.cs
- Comparer.cs
- RegistrySecurity.cs
- FlowDecisionLabelFeature.cs
- RangeValuePattern.cs
- SessionStateItemCollection.cs
- EntitySetDataBindingList.cs
- PropertyInformationCollection.cs
- TypeCodeDomSerializer.cs
- RijndaelManaged.cs
- FileLevelControlBuilderAttribute.cs
- EntityModelBuildProvider.cs
- storepermission.cs
- FilteredXmlReader.cs
- IteratorFilter.cs
- _AuthenticationState.cs
- EntityModelSchemaGenerator.cs
- SessionPageStatePersister.cs
- AdornerDecorator.cs
- AbsoluteQuery.cs
- PrintEvent.cs
- DesignBinding.cs
- HttpWebResponse.cs
- IdentifierCollection.cs
- WindowsStreamSecurityBindingElement.cs
- SelectionRange.cs
- ParamArrayAttribute.cs
- DataControlFieldCollection.cs
- ScrollViewer.cs
- TypeUsageBuilder.cs
- CodeIdentifiers.cs
- TypeDependencyAttribute.cs
- SpoolingTask.cs
- SignatureDescription.cs
- Point3DAnimation.cs
- UInt32Storage.cs
- DocumentXPathNavigator.cs
- TagMapCollection.cs
- VisualTreeUtils.cs
- SelectionPatternIdentifiers.cs
- PropVariant.cs
- Function.cs
- CryptoProvider.cs
- DecimalConverter.cs
- AutomationFocusChangedEventArgs.cs
- RunClient.cs
- XmlChildNodes.cs
- ToolStripHighContrastRenderer.cs
- WeakEventTable.cs
- SqlServices.cs
- RandomNumberGenerator.cs
- X509Certificate2Collection.cs
- UriTemplateClientFormatter.cs
- BaseDataList.cs
- odbcmetadatacolumnnames.cs
- DESCryptoServiceProvider.cs
- AsymmetricSignatureDeformatter.cs
- EtwTrace.cs
- PointUtil.cs
- TemplateNameScope.cs
- LocalizableAttribute.cs
- PriorityQueue.cs
- DbMetaDataColumnNames.cs
- ProcessingInstructionAction.cs
- SqlTriggerContext.cs
- AddingNewEventArgs.cs
- DataListItemEventArgs.cs
- PlacementWorkspace.cs
- SecurityHelper.cs
- Converter.cs
- SBCSCodePageEncoding.cs
- SystemColors.cs
- WrappingXamlSchemaContext.cs
- HttpClientCertificate.cs
- DefaultTextStoreTextComposition.cs