Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / NetworkInformation / SystemTcpStatistics.cs / 1 / SystemTcpStatistics.cs
///
/// Provides support for ip configuation information and statistics.
///
///
namespace System.Net.NetworkInformation {
using System.Net.Sockets;
using System;
using System.ComponentModel;
/// Tcp specific statistics.
internal class SystemTcpStatistics:TcpStatistics {
MibTcpStats stats;
private SystemTcpStatistics(){}
internal SystemTcpStatistics(AddressFamily family){
uint result;
if (!ComNetOS.IsPostWin2K){
if (family!= AddressFamily.InterNetwork){
throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired));
}
result = UnsafeNetInfoNativeMethods.GetTcpStatistics(out stats);
}
else
result = UnsafeNetInfoNativeMethods.GetTcpStatisticsEx(out stats, family);
if (result != IpHelperErrors.Success) {
throw new NetworkInformationException((int)result);
}
}
public override long MinimumTransmissionTimeout{get {return stats.minimumRetransmissionTimeOut;}}
public override long MaximumTransmissionTimeout{get {return stats.maximumRetransmissionTimeOut;}}
public override long MaximumConnections{get {return stats.maximumConnections;}}
public override long ConnectionsInitiated{get {return stats.activeOpens;}}
public override long ConnectionsAccepted{get {return stats.passiveOpens;}}// is this true? We should check
public override long FailedConnectionAttempts{get {return stats.failedConnectionAttempts;}}
public override long ResetConnections{get {return stats.resetConnections;}}
public override long CurrentConnections{get {return stats.currentConnections;}}
public override long SegmentsReceived{get {return stats.segmentsReceived;}}
public override long SegmentsSent{get {return stats.segmentsSent;}}
public override long SegmentsResent{get {return stats.segmentsResent;}}
public override long ErrorsReceived{get {return stats.errorsReceived;}}
public override long ResetsSent{get {return stats.segmentsSentWithReset;}}
public override long CumulativeConnections{get {return stats.cumulativeConnections;}}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
///
/// Provides support for ip configuation information and statistics.
///
///
namespace System.Net.NetworkInformation {
using System.Net.Sockets;
using System;
using System.ComponentModel;
/// Tcp specific statistics.
internal class SystemTcpStatistics:TcpStatistics {
MibTcpStats stats;
private SystemTcpStatistics(){}
internal SystemTcpStatistics(AddressFamily family){
uint result;
if (!ComNetOS.IsPostWin2K){
if (family!= AddressFamily.InterNetwork){
throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired));
}
result = UnsafeNetInfoNativeMethods.GetTcpStatistics(out stats);
}
else
result = UnsafeNetInfoNativeMethods.GetTcpStatisticsEx(out stats, family);
if (result != IpHelperErrors.Success) {
throw new NetworkInformationException((int)result);
}
}
public override long MinimumTransmissionTimeout{get {return stats.minimumRetransmissionTimeOut;}}
public override long MaximumTransmissionTimeout{get {return stats.maximumRetransmissionTimeOut;}}
public override long MaximumConnections{get {return stats.maximumConnections;}}
public override long ConnectionsInitiated{get {return stats.activeOpens;}}
public override long ConnectionsAccepted{get {return stats.passiveOpens;}}// is this true? We should check
public override long FailedConnectionAttempts{get {return stats.failedConnectionAttempts;}}
public override long ResetConnections{get {return stats.resetConnections;}}
public override long CurrentConnections{get {return stats.currentConnections;}}
public override long SegmentsReceived{get {return stats.segmentsReceived;}}
public override long SegmentsSent{get {return stats.segmentsSent;}}
public override long SegmentsResent{get {return stats.segmentsResent;}}
public override long ErrorsReceived{get {return stats.errorsReceived;}}
public override long ResetsSent{get {return stats.segmentsSentWithReset;}}
public override long CumulativeConnections{get {return stats.cumulativeConnections;}}
}
}
// 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
- SafeTokenHandle.cs
- AsyncResult.cs
- WindowsAuthenticationModule.cs
- ConnectionStringsExpressionBuilder.cs
- SqlProvider.cs
- DocumentsTrace.cs
- BufferedWebEventProvider.cs
- PasswordDeriveBytes.cs
- FlowDocument.cs
- DBCommand.cs
- IPGlobalProperties.cs
- VariableQuery.cs
- CodeEntryPointMethod.cs
- HttpCacheVaryByContentEncodings.cs
- Group.cs
- AsymmetricAlgorithm.cs
- Vertex.cs
- GPPOINT.cs
- CfgSemanticTag.cs
- CapabilitiesSection.cs
- EntryPointNotFoundException.cs
- HttpRawResponse.cs
- Vector3D.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- FormatVersion.cs
- KnownBoxes.cs
- assertwrapper.cs
- ReadOnlyDictionary.cs
- DashStyle.cs
- CanExecuteRoutedEventArgs.cs
- CfgParser.cs
- ToolBarTray.cs
- IndicShape.cs
- StackSpiller.Temps.cs
- CompiledIdentityConstraint.cs
- WindowsGraphics2.cs
- XmlSchemaSequence.cs
- TableLayoutStyleCollection.cs
- InvalidPrinterException.cs
- TemplateBindingExpressionConverter.cs
- FormView.cs
- Restrictions.cs
- ListViewDeleteEventArgs.cs
- ReliableSessionBindingElementImporter.cs
- FileCodeGroup.cs
- FacetChecker.cs
- ProfileSettingsCollection.cs
- MenuRendererStandards.cs
- ThemeDictionaryExtension.cs
- HtmlImage.cs
- CFStream.cs
- Method.cs
- GridItem.cs
- MaskInputRejectedEventArgs.cs
- ToggleButtonAutomationPeer.cs
- AutomationPattern.cs
- FrameAutomationPeer.cs
- HeaderUtility.cs
- ScalarRestriction.cs
- ObjectSecurity.cs
- EditableTreeList.cs
- XmlDataProvider.cs
- SelectedDatesCollection.cs
- NullableDoubleMinMaxAggregationOperator.cs
- MexHttpBindingElement.cs
- WebControlAdapter.cs
- ArgumentValue.cs
- DataControlFieldCell.cs
- ValueSerializerAttribute.cs
- EncryptedType.cs
- DataControlImageButton.cs
- HtmlFormAdapter.cs
- SqlFormatter.cs
- IpcChannelHelper.cs
- PenThread.cs
- NativeObjectSecurity.cs
- MonthCalendar.cs
- LZCodec.cs
- TerminatorSinks.cs
- AttributeQuery.cs
- JsonReader.cs
- Condition.cs
- MonitoringDescriptionAttribute.cs
- SqlDependencyUtils.cs
- OpenFileDialog.cs
- DoubleLinkListEnumerator.cs
- Label.cs
- User.cs
- DbConnectionInternal.cs
- RemotingHelper.cs
- KeyEvent.cs
- UserUseLicenseDictionaryLoader.cs
- InputLanguageEventArgs.cs
- SpellCheck.cs
- DataRecord.cs
- BamlTreeNode.cs
- ClientSettingsProvider.cs
- ReflectionTypeLoadException.cs
- SelectedDatesCollection.cs
- QilPatternVisitor.cs