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
- XmlnsCompatibleWithAttribute.cs
- DesignerSerializationVisibilityAttribute.cs
- ResourceDefaultValueAttribute.cs
- ElementsClipboardData.cs
- CaseInsensitiveComparer.cs
- XPathException.cs
- GeometryDrawing.cs
- IncrementalHitTester.cs
- ThicknessConverter.cs
- SequenceDesigner.xaml.cs
- JsonServiceDocumentSerializer.cs
- MultiDataTrigger.cs
- WorkflowRuntimeSection.cs
- AuthenticationModuleElement.cs
- SafeProcessHandle.cs
- RegexCode.cs
- NativeMethodsCLR.cs
- FixedPageAutomationPeer.cs
- FlowDocumentPage.cs
- LoopExpression.cs
- ZipFileInfoCollection.cs
- DataGridViewRowPrePaintEventArgs.cs
- DictionaryEntry.cs
- XamlToRtfWriter.cs
- FileController.cs
- PhysicalAddress.cs
- AdvancedBindingPropertyDescriptor.cs
- SerTrace.cs
- SecUtil.cs
- WindowProviderWrapper.cs
- EventlogProvider.cs
- SerialReceived.cs
- SpeakCompletedEventArgs.cs
- AsyncPostBackErrorEventArgs.cs
- MenuTracker.cs
- EventProviderBase.cs
- DefaultTraceListener.cs
- FixUpCollection.cs
- SmiEventSink.cs
- Validator.cs
- WebEventTraceProvider.cs
- CommandTreeTypeHelper.cs
- ProtocolsConfigurationEntry.cs
- PassportAuthenticationModule.cs
- TextSegment.cs
- COM2EnumConverter.cs
- CommandDevice.cs
- RenderData.cs
- XPathException.cs
- ResourceType.cs
- PeerNameRecordCollection.cs
- BooleanAnimationBase.cs
- CustomCredentialPolicy.cs
- IDReferencePropertyAttribute.cs
- IdentifierCollection.cs
- TrackingConditionCollection.cs
- RepeaterItemCollection.cs
- VersionedStream.cs
- ResponseStream.cs
- DataGridViewTopRowAccessibleObject.cs
- SharedRuntimeState.cs
- SafeFindHandle.cs
- MouseBinding.cs
- Random.cs
- TcpServerChannel.cs
- XPathAxisIterator.cs
- XomlSerializationHelpers.cs
- RealProxy.cs
- assertwrapper.cs
- TableProvider.cs
- BoolExpr.cs
- DataServiceRequestOfT.cs
- SqlXmlStorage.cs
- XmlHelper.cs
- UInt32.cs
- DrawingVisualDrawingContext.cs
- HtmlLink.cs
- InvalidEnumArgumentException.cs
- NotificationContext.cs
- AlignmentXValidation.cs
- TableLayoutColumnStyleCollection.cs
- Property.cs
- Brushes.cs
- FontFaceLayoutInfo.cs
- FileLogRecordEnumerator.cs
- SpinLock.cs
- CodeMemberProperty.cs
- _ConnectionGroup.cs
- LeftCellWrapper.cs
- DBDataPermission.cs
- GraphicsContainer.cs
- PageThemeCodeDomTreeGenerator.cs
- _TimerThread.cs
- ItemList.cs
- XmlSchemaValidationException.cs
- WebEventCodes.cs
- XmlAutoDetectWriter.cs
- PeerApplicationLaunchInfo.cs
- LockCookie.cs
- Point3DValueSerializer.cs