Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / NetworkInformation / SystemUdpStatistics.cs / 1305376 / 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
- DisableDpiAwarenessAttribute.cs
- TransactionFilter.cs
- MemoryMappedViewStream.cs
- ListViewInsertEventArgs.cs
- FtpWebRequest.cs
- IApplicationTrustManager.cs
- ClientSideQueueItem.cs
- ApplicationServiceManager.cs
- RSAOAEPKeyExchangeFormatter.cs
- WorkflowTimerService.cs
- SevenBitStream.cs
- BamlTreeUpdater.cs
- WindowShowOrOpenTracker.cs
- DataGridViewComponentPropertyGridSite.cs
- RestHandlerFactory.cs
- HtmlShim.cs
- X509SecurityTokenProvider.cs
- CreateUserErrorEventArgs.cs
- Vector3DAnimationUsingKeyFrames.cs
- SiteMapHierarchicalDataSourceView.cs
- RIPEMD160Managed.cs
- MonthChangedEventArgs.cs
- TimeZone.cs
- URIFormatException.cs
- UnsafeNativeMethods.cs
- EpmSyndicationContentSerializer.cs
- MarkupCompilePass1.cs
- Int16.cs
- Visitor.cs
- RichTextBox.cs
- ScrollViewer.cs
- VirtualPath.cs
- DateTimeOffsetConverter.cs
- XmlElementAttributes.cs
- SQLDoubleStorage.cs
- RequestCachingSection.cs
- WebPartActionVerb.cs
- SoapServerMethod.cs
- Funcletizer.cs
- ProxyGenerator.cs
- Translator.cs
- BookmarkEventArgs.cs
- XmlSchemaAppInfo.cs
- WpfMemberInvoker.cs
- OLEDB_Util.cs
- ProfileGroupSettings.cs
- Viewport2DVisual3D.cs
- cookiecontainer.cs
- SelectionWordBreaker.cs
- DataTemplateKey.cs
- ContainerControl.cs
- TypedDatasetGenerator.cs
- EntityDataSourceWizardForm.cs
- TypeInfo.cs
- ColumnMapTranslator.cs
- StylusTip.cs
- Point3DCollection.cs
- Selector.cs
- TextDecorationUnitValidation.cs
- DataContractSerializer.cs
- PrimarySelectionGlyph.cs
- EmptyStringExpandableObjectConverter.cs
- MappingMetadataHelper.cs
- MessageRpc.cs
- SkinBuilder.cs
- FixedFlowMap.cs
- Activator.cs
- ResXFileRef.cs
- ScrollChrome.cs
- PerfService.cs
- EmptyStringExpandableObjectConverter.cs
- RequestUriProcessor.cs
- ManifestResourceInfo.cs
- PenContexts.cs
- DocumentAutomationPeer.cs
- WaitHandleCannotBeOpenedException.cs
- ComContractElement.cs
- TextPointer.cs
- LinqExpressionNormalizer.cs
- ISO2022Encoding.cs
- DataGridColumnHeadersPresenter.cs
- WebMessageEncodingElement.cs
- String.cs
- WindowsComboBox.cs
- ColorInterpolationModeValidation.cs
- SafeNativeMemoryHandle.cs
- RuleInfoComparer.cs
- IpcPort.cs
- XamlSerializerUtil.cs
- __ConsoleStream.cs
- MimeObjectFactory.cs
- BindToObject.cs
- SoundPlayerAction.cs
- NegatedCellConstant.cs
- ProcessDesigner.cs
- RbTree.cs
- IgnoreSectionHandler.cs
- StrongNamePublicKeyBlob.cs
- FragmentQueryKB.cs
- ErrorCodes.cs