Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / NetworkInformation / SystemUdpStatistics.cs / 1 / SystemUdpStatistics.cs
////// namespace System.Net.NetworkInformation { using System.Net.Sockets; using System; using System.ComponentModel; /// /// Provides support for ip configuation information and statistics. /// Udp statistics. internal class SystemUdpStatistics:UdpStatistics { MibUdpStats stats; private SystemUdpStatistics(){} internal SystemUdpStatistics(AddressFamily family){ uint result; if (!ComNetOS.IsPostWin2K){ if (family!= AddressFamily.InterNetwork){ throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired)); } result = UnsafeNetInfoNativeMethods.GetUdpStatistics(out stats); } else result = UnsafeNetInfoNativeMethods.GetUdpStatisticsEx(out stats, family); if (result != IpHelperErrors.Success) { throw new NetworkInformationException((int)result); } } public override long DatagramsReceived{get {return stats.datagramsReceived;}} public override long IncomingDatagramsDiscarded{get {return stats.incomingDatagramsDiscarded;}} public override long IncomingDatagramsWithErrors{get {return stats.incomingDatagramsWithErrors;}} public override long DatagramsSent{get {return stats.datagramsSent;}} public override int UdpListeners{get {return (int)stats.udpListeners;}} } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. ////// namespace System.Net.NetworkInformation { using System.Net.Sockets; using System; using System.ComponentModel; /// /// Provides support for ip configuation information and statistics. /// Udp statistics. internal class SystemUdpStatistics:UdpStatistics { MibUdpStats stats; private SystemUdpStatistics(){} internal SystemUdpStatistics(AddressFamily family){ uint result; if (!ComNetOS.IsPostWin2K){ if (family!= AddressFamily.InterNetwork){ throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired)); } result = UnsafeNetInfoNativeMethods.GetUdpStatistics(out stats); } else result = UnsafeNetInfoNativeMethods.GetUdpStatisticsEx(out stats, family); if (result != IpHelperErrors.Success) { throw new NetworkInformationException((int)result); } } public override long DatagramsReceived{get {return stats.datagramsReceived;}} public override long IncomingDatagramsDiscarded{get {return stats.incomingDatagramsDiscarded;}} public override long IncomingDatagramsWithErrors{get {return stats.incomingDatagramsWithErrors;}} public override long DatagramsSent{get {return stats.datagramsSent;}} public override int UdpListeners{get {return (int)stats.udpListeners;}} } } // 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
- OracleColumn.cs
- InvalidEnumArgumentException.cs
- ObjectQueryProvider.cs
- DataViewListener.cs
- ControlPropertyNameConverter.cs
- RegexTypeEditor.cs
- ObjectAnimationUsingKeyFrames.cs
- AnimationLayer.cs
- WorkflowServiceHostFactory.cs
- SimpleTextLine.cs
- TextTreeTextBlock.cs
- FieldBuilder.cs
- DesignOnlyAttribute.cs
- RangeContentEnumerator.cs
- EntityException.cs
- DecoratedNameAttribute.cs
- RSAOAEPKeyExchangeDeformatter.cs
- listviewsubitemcollectioneditor.cs
- HelpInfo.cs
- TextStore.cs
- RegexCompiler.cs
- WindowProviderWrapper.cs
- OpenFileDialog.cs
- JavaScriptString.cs
- Lock.cs
- OutputCacheSettings.cs
- Assert.cs
- WinFormsUtils.cs
- EntitySetBase.cs
- Image.cs
- LinqDataSourceStatusEventArgs.cs
- Int64Storage.cs
- CurrentChangingEventManager.cs
- TextServicesCompartment.cs
- DirtyTextRange.cs
- NameSpaceExtractor.cs
- ZoneLinkButton.cs
- PrintPreviewDialog.cs
- RequestStatusBarUpdateEventArgs.cs
- InfoCardClaimCollection.cs
- TextRenderingModeValidation.cs
- CollectionViewGroup.cs
- OutputCacheSettings.cs
- Track.cs
- TextBoxAutomationPeer.cs
- AnnouncementService.cs
- ListCommandEventArgs.cs
- EditorZoneBase.cs
- DesignerDataTableBase.cs
- IgnoreFileBuildProvider.cs
- LineSegment.cs
- ScriptDescriptor.cs
- CapiHashAlgorithm.cs
- LazyTextWriterCreator.cs
- BitArray.cs
- ToolStripDropDownItem.cs
- DataGridViewColumnHeaderCell.cs
- UnmanagedMemoryStreamWrapper.cs
- ColorContextHelper.cs
- DataGridViewToolTip.cs
- validationstate.cs
- FloatUtil.cs
- TextParagraphProperties.cs
- CommandBindingCollection.cs
- ObjectStateManagerMetadata.cs
- TextRunCacheImp.cs
- FillRuleValidation.cs
- WorkflowMarkupSerializerMapping.cs
- DebugView.cs
- ObjectStateManagerMetadata.cs
- CleanUpVirtualizedItemEventArgs.cs
- SafeHandles.cs
- StorageEntityTypeMapping.cs
- UriScheme.cs
- BooleanFacetDescriptionElement.cs
- SiteMapDesignerDataSourceView.cs
- ColorConverter.cs
- ObjectFullSpanRewriter.cs
- ViewKeyConstraint.cs
- DispatcherBuilder.cs
- DesigntimeLicenseContext.cs
- PropertyPathWorker.cs
- SplineKeyFrames.cs
- SchemaCollectionPreprocessor.cs
- TextDecoration.cs
- MemberExpression.cs
- DetailsViewCommandEventArgs.cs
- LineMetrics.cs
- LineVisual.cs
- ReadOnlyPropertyMetadata.cs
- RefExpr.cs
- XmlComment.cs
- XmlQualifiedName.cs
- MenuItemCollectionEditor.cs
- ComplexType.cs
- WebPartHelpVerb.cs
- ContractInstanceProvider.cs
- ContractTypeNameElement.cs
- InstancePersistenceCommand.cs
- DefaultTextStore.cs