Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / SecureProtocols / AuthenticatedStream.cs / 1 / AuthenticatedStream.cs
/*++
Copyright (c) 2003 Microsoft Corporation
Module Name:
AuthenticatedStream.cs
Abstract:
A public contact for a base abstract authenticated stream.
Author:
Alexei Vopilov Sept 28-2003
Revision History:
--*/
namespace System.Net.Security {
using System;
using System.IO;
using System.Threading;
using System.Security.Permissions;
using System.Security.Principal;
public abstract class AuthenticatedStream: Stream
{
private Stream _InnerStream;
private bool _LeaveStreamOpen;
protected AuthenticatedStream(Stream innerStream, bool leaveInnerStreamOpen)
{
if (innerStream == null || innerStream == Stream.Null) {
throw new ArgumentNullException("innerStream");
}
if (!innerStream.CanRead || !innerStream.CanWrite) {
throw new ArgumentException(SR.GetString(SR.net_io_must_be_rw_stream), "innerStream");
}
_InnerStream = innerStream;
_LeaveStreamOpen = leaveInnerStreamOpen;
}
public bool LeaveInnerStreamOpen {
get {
return _LeaveStreamOpen;
}
}
//
//
protected Stream InnerStream {
get {
return _InnerStream;
}
}
//
//
protected override void Dispose(bool disposing)
{
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User)) {
#endif
try
{
if (disposing)
{
if (_LeaveStreamOpen)
{
_InnerStream.Flush();
}
else
{
_InnerStream.Close();
}
}
}
finally
{
base.Dispose(disposing);
}
#if DEBUG
}
#endif
}
//
// General informational properties
//
public abstract bool IsAuthenticated {get;}
public abstract bool IsMutuallyAuthenticated {get;}
public abstract bool IsEncrypted {get;}
public abstract bool IsSigned {get;}
public abstract bool IsServer {get;}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
/*++
Copyright (c) 2003 Microsoft Corporation
Module Name:
AuthenticatedStream.cs
Abstract:
A public contact for a base abstract authenticated stream.
Author:
Alexei Vopilov Sept 28-2003
Revision History:
--*/
namespace System.Net.Security {
using System;
using System.IO;
using System.Threading;
using System.Security.Permissions;
using System.Security.Principal;
public abstract class AuthenticatedStream: Stream
{
private Stream _InnerStream;
private bool _LeaveStreamOpen;
protected AuthenticatedStream(Stream innerStream, bool leaveInnerStreamOpen)
{
if (innerStream == null || innerStream == Stream.Null) {
throw new ArgumentNullException("innerStream");
}
if (!innerStream.CanRead || !innerStream.CanWrite) {
throw new ArgumentException(SR.GetString(SR.net_io_must_be_rw_stream), "innerStream");
}
_InnerStream = innerStream;
_LeaveStreamOpen = leaveInnerStreamOpen;
}
public bool LeaveInnerStreamOpen {
get {
return _LeaveStreamOpen;
}
}
//
//
protected Stream InnerStream {
get {
return _InnerStream;
}
}
//
//
protected override void Dispose(bool disposing)
{
#if DEBUG
using (GlobalLog.SetThreadKind(ThreadKinds.User)) {
#endif
try
{
if (disposing)
{
if (_LeaveStreamOpen)
{
_InnerStream.Flush();
}
else
{
_InnerStream.Close();
}
}
}
finally
{
base.Dispose(disposing);
}
#if DEBUG
}
#endif
}
//
// General informational properties
//
public abstract bool IsAuthenticated {get;}
public abstract bool IsMutuallyAuthenticated {get;}
public abstract bool IsEncrypted {get;}
public abstract bool IsSigned {get;}
public abstract bool IsServer {get;}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Attributes.cs
- ListenerElementsCollection.cs
- XAMLParseException.cs
- MarkupProperty.cs
- ToolBarOverflowPanel.cs
- ObjectDataSourceChooseMethodsPanel.cs
- HandlerElement.cs
- UDPClient.cs
- NullableIntAverageAggregationOperator.cs
- FontStyles.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- ScriptReference.cs
- PathFigure.cs
- SecurityElement.cs
- CompiledWorkflowDefinitionContext.cs
- ErrorReporting.cs
- WebUtil.cs
- TextBoxBase.cs
- RawMouseInputReport.cs
- LineServices.cs
- UnsafeNetInfoNativeMethods.cs
- RowTypeElement.cs
- PersonalizablePropertyEntry.cs
- SingleAnimationUsingKeyFrames.cs
- AutomationEvent.cs
- HashCodeCombiner.cs
- IconHelper.cs
- InputBuffer.cs
- KeyValueSerializer.cs
- PropertySourceInfo.cs
- TextPenaltyModule.cs
- AssignDesigner.xaml.cs
- StringBuilder.cs
- CacheHelper.cs
- CreateUserWizard.cs
- FileDataSourceCache.cs
- SqlBuilder.cs
- XD.cs
- InvalidOleVariantTypeException.cs
- VSWCFServiceContractGenerator.cs
- DataSourceCache.cs
- UserNamePasswordValidator.cs
- ReadOnlyDictionary.cs
- MimeParameterWriter.cs
- FlowPosition.cs
- WebSysDisplayNameAttribute.cs
- BaseTemplatedMobileComponentEditor.cs
- Win32KeyboardDevice.cs
- DescendantOverDescendantQuery.cs
- ResXFileRef.cs
- DoubleCollection.cs
- EpmContentDeSerializerBase.cs
- SeekStoryboard.cs
- Workspace.cs
- CmsInterop.cs
- CodeBlockBuilder.cs
- ComponentConverter.cs
- CLSCompliantAttribute.cs
- AsyncStreamReader.cs
- TypedAsyncResult.cs
- OperatorExpressions.cs
- GridViewSelectEventArgs.cs
- TemplateApplicationHelper.cs
- ButtonChrome.cs
- Barrier.cs
- FixedPageStructure.cs
- TableItemStyle.cs
- CodeIdentifier.cs
- SessionEndingEventArgs.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- CodeTypeParameter.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- SystemNetworkInterface.cs
- MetadataSerializer.cs
- Literal.cs
- CachingParameterInspector.cs
- TemplatePartAttribute.cs
- ObjectDataSourceFilteringEventArgs.cs
- DataGridViewRowPrePaintEventArgs.cs
- LinearQuaternionKeyFrame.cs
- PreviousTrackingServiceAttribute.cs
- CodeDOMUtility.cs
- SystemWebCachingSectionGroup.cs
- TraceShell.cs
- DeclaredTypeElement.cs
- ThrowHelper.cs
- DefaultParameterValueAttribute.cs
- PermissionSet.cs
- FtpRequestCacheValidator.cs
- SettingsProperty.cs
- X509Certificate2Collection.cs
- Stack.cs
- shaperfactoryquerycacheentry.cs
- GlyphCache.cs
- ResourceDescriptionAttribute.cs
- COM2TypeInfoProcessor.cs
- InheritedPropertyChangedEventArgs.cs
- InitializeCorrelation.cs
- Matrix3DConverter.cs
- HtmlShim.cs