Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- WebHostUnsafeNativeMethods.cs
- ProfessionalColorTable.cs
- ListViewHitTestInfo.cs
- Enum.cs
- SmtpFailedRecipientsException.cs
- InstallerTypeAttribute.cs
- NullableIntMinMaxAggregationOperator.cs
- XmlSerializerVersionAttribute.cs
- CustomAttribute.cs
- PresentationSource.cs
- StaticSiteMapProvider.cs
- WorkflowInlining.cs
- RealizationDrawingContextWalker.cs
- FullTextBreakpoint.cs
- DataViewManager.cs
- BufferedGraphics.cs
- PartialClassGenerationTask.cs
- TypeHelpers.cs
- PageHandlerFactory.cs
- OdbcEnvironmentHandle.cs
- DataGridCaption.cs
- Byte.cs
- FrameworkObject.cs
- PageAsyncTask.cs
- _BaseOverlappedAsyncResult.cs
- TransformedBitmap.cs
- DefaultAsyncDataDispatcher.cs
- LayoutEditorPart.cs
- StorageSetMapping.cs
- Inline.cs
- CultureMapper.cs
- MoveSizeWinEventHandler.cs
- ReadContentAsBinaryHelper.cs
- MdiWindowListStrip.cs
- AnimationTimeline.cs
- ChtmlTextWriter.cs
- FakeModelItemImpl.cs
- CompareInfo.cs
- While.cs
- Matrix3DConverter.cs
- BooleanExpr.cs
- SolidBrush.cs
- UIElementParaClient.cs
- GridViewRowPresenter.cs
- QueuePropertyVariants.cs
- ReceiveSecurityHeader.cs
- OneWayChannelListener.cs
- FontDialog.cs
- StrokeIntersection.cs
- SoapCodeExporter.cs
- MSG.cs
- WebBrowserDesigner.cs
- SecurityUtils.cs
- HttpConfigurationSystem.cs
- OracleEncoding.cs
- DispatcherHookEventArgs.cs
- MatrixTransform3D.cs
- DoubleCollectionValueSerializer.cs
- CompoundFileStreamReference.cs
- XmlSchemaChoice.cs
- DiscoveryEndpoint.cs
- HttpListenerContext.cs
- XmlJsonReader.cs
- MoveSizeWinEventHandler.cs
- VisualTransition.cs
- ITextView.cs
- CryptoApi.cs
- XXXOnTypeBuilderInstantiation.cs
- ISAPIApplicationHost.cs
- MatrixCamera.cs
- Renderer.cs
- KeysConverter.cs
- EntityDataSourceDesigner.cs
- TextBoxBase.cs
- UpdatePanelTriggerCollection.cs
- ResolvedKeyFrameEntry.cs
- CodeThrowExceptionStatement.cs
- SystemWebCachingSectionGroup.cs
- TextEndOfSegment.cs
- FieldToken.cs
- WebBrowserPermission.cs
- WindowsStatusBar.cs
- Figure.cs
- DeadCharTextComposition.cs
- SafeProcessHandle.cs
- MsmqProcessProtocolHandler.cs
- ContentType.cs
- TemplateBuilder.cs
- ServiceReference.cs
- RemoteX509Token.cs
- TableItemPattern.cs
- BufferedStream.cs
- WebResponse.cs
- AttributeCollection.cs
- AuthenticateEventArgs.cs
- HttpDigestClientElement.cs
- Drawing.cs
- DataControlFieldCell.cs
- ComboBox.cs
- AttributedMetaModel.cs