Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Net / System / Net / TransportContext.cs / 1 / 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. //------------------------------------------------------------------------------ //// 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
- CustomActivityDesigner.cs
- JapaneseLunisolarCalendar.cs
- FieldToken.cs
- GlobalAllocSafeHandle.cs
- SqlColumnizer.cs
- StreamResourceInfo.cs
- HttpListenerRequest.cs
- OutputCacheSection.cs
- ContextStaticAttribute.cs
- CharStorage.cs
- GPRECTF.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- WsdlInspector.cs
- ADRoleFactory.cs
- DynamicValidatorEventArgs.cs
- SrgsRule.cs
- _DisconnectOverlappedAsyncResult.cs
- FormatVersion.cs
- RunInstallerAttribute.cs
- MouseActionValueSerializer.cs
- DataContractSerializer.cs
- GroupBox.cs
- MDIClient.cs
- ListViewGroup.cs
- FixedPage.cs
- ActiveXHelper.cs
- CodeMemberProperty.cs
- WebPartConnectionsDisconnectVerb.cs
- OnOperation.cs
- AppendHelper.cs
- XmlSerializableServices.cs
- RemotingException.cs
- XmlValidatingReaderImpl.cs
- MembershipSection.cs
- AxisAngleRotation3D.cs
- DataBoundControlAdapter.cs
- DictionaryManager.cs
- IndicFontClient.cs
- PageClientProxyGenerator.cs
- ObjectDataSourceMethodEventArgs.cs
- RunWorkerCompletedEventArgs.cs
- HtmlElementCollection.cs
- StretchValidation.cs
- SqlBuilder.cs
- TextContainerChangedEventArgs.cs
- VirtualPathProvider.cs
- Schema.cs
- WindowsRichEditRange.cs
- EventMap.cs
- TransformDescriptor.cs
- RSACryptoServiceProvider.cs
- IgnoreFlushAndCloseStream.cs
- ProtocolViolationException.cs
- TagNameToTypeMapper.cs
- DefaultHttpHandler.cs
- ParameterExpression.cs
- _IPv6Address.cs
- Point4D.cs
- HMACMD5.cs
- UnsafeNativeMethods.cs
- BamlVersionHeader.cs
- TableCellAutomationPeer.cs
- RevocationPoint.cs
- RoutedEventConverter.cs
- PerspectiveCamera.cs
- TogglePatternIdentifiers.cs
- CreateUserWizardStep.cs
- CheckoutException.cs
- DivideByZeroException.cs
- CursorConverter.cs
- Misc.cs
- ImageCodecInfoPrivate.cs
- CodePrimitiveExpression.cs
- TerminatingOperationBehavior.cs
- ImmutableObjectAttribute.cs
- Keywords.cs
- DetailsViewActionList.cs
- __FastResourceComparer.cs
- _RegBlobWebProxyDataBuilder.cs
- XmlObjectSerializer.cs
- FrameworkElementFactory.cs
- AsyncPostBackErrorEventArgs.cs
- TextFormatterImp.cs
- FormatterConverter.cs
- QualificationDataItem.cs
- TokenBasedSet.cs
- ListViewCommandEventArgs.cs
- XmlDocumentType.cs
- HttpInputStream.cs
- MemberAssignmentAnalysis.cs
- ToolStripDropDownMenu.cs
- TrimSurroundingWhitespaceAttribute.cs
- HtmlInputCheckBox.cs
- printdlgexmarshaler.cs
- UnsafeNativeMethods.cs
- Wow64ConfigurationLoader.cs
- WebHttpSecurityElement.cs
- Sentence.cs
- EntityClassGenerator.cs
- QilLiteral.cs