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
- RuleSettingsCollection.cs
- DataObjectAttribute.cs
- MutexSecurity.cs
- SchemaImporterExtensionElement.cs
- DataGridViewComboBoxCell.cs
- SqlDataSourceSelectingEventArgs.cs
- XmlCDATASection.cs
- HtmlTextViewAdapter.cs
- FormsAuthenticationUser.cs
- Walker.cs
- TextAdaptor.cs
- AggregatePushdown.cs
- EventEntry.cs
- UInt16Storage.cs
- nulltextnavigator.cs
- GridViewDeleteEventArgs.cs
- Imaging.cs
- ParentQuery.cs
- BinaryObjectInfo.cs
- Facet.cs
- BitmapEffectGroup.cs
- RegexRunner.cs
- BasicDesignerLoader.cs
- FreezableDefaultValueFactory.cs
- TreeViewTemplateSelector.cs
- FilterException.cs
- NetworkCredential.cs
- DetailsViewDeletedEventArgs.cs
- TextEditorTables.cs
- MergeLocalizationDirectives.cs
- FontStyle.cs
- ZipIOExtraFieldElement.cs
- WebPartEventArgs.cs
- RawMouseInputReport.cs
- X509Utils.cs
- storepermissionattribute.cs
- RadioButtonDesigner.cs
- FrameworkContentElementAutomationPeer.cs
- Debugger.cs
- JsonXmlDataContract.cs
- COM2ExtendedTypeConverter.cs
- ToolStripComboBox.cs
- PropertyValueUIItem.cs
- InheritedPropertyDescriptor.cs
- DataServiceClientException.cs
- StrokeSerializer.cs
- ProxyWebPart.cs
- CharAnimationUsingKeyFrames.cs
- HttpModuleActionCollection.cs
- WhitespaceRuleReader.cs
- TreePrinter.cs
- FixedLineResult.cs
- RC2CryptoServiceProvider.cs
- Model3D.cs
- TemplateBuilder.cs
- UrlAuthFailedErrorFormatter.cs
- KeyGesture.cs
- ArgumentOutOfRangeException.cs
- SiteMembershipCondition.cs
- StylusDownEventArgs.cs
- XmlUtil.cs
- StringResourceManager.cs
- EdgeProfileValidation.cs
- RegexWriter.cs
- SchemaTypeEmitter.cs
- AutomationElementIdentifiers.cs
- ConnectionStringSettingsCollection.cs
- DragStartedEventArgs.cs
- XmlReturnWriter.cs
- CannotUnloadAppDomainException.cs
- LoadWorkflowByInstanceKeyCommand.cs
- IImplicitResourceProvider.cs
- JsonWriterDelegator.cs
- RootNamespaceAttribute.cs
- Vector3DCollection.cs
- ConfigurationStrings.cs
- TableColumn.cs
- WebScriptEnablingBehavior.cs
- GeneralTransform3DCollection.cs
- ObjectDataSourceDisposingEventArgs.cs
- SqlCachedBuffer.cs
- ClientRoleProvider.cs
- DateRangeEvent.cs
- DelegateTypeInfo.cs
- ServiceElementCollection.cs
- EventLogPermission.cs
- CodeAttributeArgument.cs
- SecurityHelper.cs
- KeyedQueue.cs
- IndexedString.cs
- ReadOnlyDictionary.cs
- XmlSchemaSet.cs
- NeedSkipTokenVisitor.cs
- Emitter.cs
- HttpResponseMessageProperty.cs
- HtmlInputRadioButton.cs
- EntityTypeBase.cs
- XmlSchemaDatatype.cs
- PropertyMetadata.cs
- SqlDataSourceCommandEventArgs.cs