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
- oledbmetadatacollectionnames.cs
- FactoryGenerator.cs
- ValueTable.cs
- RegularExpressionValidator.cs
- DetailsViewUpdateEventArgs.cs
- OperationInvokerBehavior.cs
- Renderer.cs
- SmiSettersStream.cs
- filewebresponse.cs
- NavigationFailedEventArgs.cs
- PeerCollaborationPermission.cs
- HandleCollector.cs
- XmlSerializerVersionAttribute.cs
- ExecutionScope.cs
- RemotingSurrogateSelector.cs
- CheckBox.cs
- DesignerOptionService.cs
- Metafile.cs
- Avt.cs
- DataTableNewRowEvent.cs
- CustomAttributeFormatException.cs
- OdbcConnectionStringbuilder.cs
- ClientFormsAuthenticationCredentials.cs
- CommandBindingCollection.cs
- CompatibleIComparer.cs
- WebPartExportVerb.cs
- UnionCodeGroup.cs
- KerberosTicketHashIdentifierClause.cs
- StaticContext.cs
- Dispatcher.cs
- ParallelForEach.cs
- MeasureItemEvent.cs
- TableColumnCollection.cs
- mediaeventshelper.cs
- BmpBitmapEncoder.cs
- SchemaNames.cs
- UInt32.cs
- CustomErrorCollection.cs
- ConnectionStringsSection.cs
- Object.cs
- DBPropSet.cs
- GcHandle.cs
- FixedTextBuilder.cs
- HostingMessageProperty.cs
- PropertyItem.cs
- objectquery_tresulttype.cs
- XslCompiledTransform.cs
- GeometryDrawing.cs
- WebPartEditorCancelVerb.cs
- nulltextcontainer.cs
- XmlSchemaDatatype.cs
- Size3D.cs
- PartialCachingAttribute.cs
- GridView.cs
- EraserBehavior.cs
- WebScriptMetadataMessageEncodingBindingElement.cs
- OleStrCAMarshaler.cs
- MouseDevice.cs
- PageThemeParser.cs
- Cursor.cs
- SystemWebCachingSectionGroup.cs
- User.cs
- RightsController.cs
- RequestQueue.cs
- TraceHandler.cs
- TraversalRequest.cs
- DiscoveryDefaults.cs
- Odbc32.cs
- BitmapEffect.cs
- If.cs
- TransactionBehavior.cs
- SqlGatherConsumedAliases.cs
- TraceContext.cs
- XPathQueryGenerator.cs
- XmlSerializationGeneratedCode.cs
- translator.cs
- XmlNamespaceDeclarationsAttribute.cs
- EdmItemError.cs
- TraceHandlerErrorFormatter.cs
- FixedSOMImage.cs
- MessageFilterException.cs
- LogEntryUtils.cs
- TextFormatterContext.cs
- FontResourceCache.cs
- GridViewAutomationPeer.cs
- TrustVersion.cs
- BufferedGraphicsContext.cs
- Exceptions.cs
- CreateUserErrorEventArgs.cs
- GeometryHitTestResult.cs
- BinaryUtilClasses.cs
- ContainerParaClient.cs
- ConnectionConsumerAttribute.cs
- NetworkCredential.cs
- COM2TypeInfoProcessor.cs
- XmlNamespaceMappingCollection.cs
- AutomationElement.cs
- ElementAction.cs
- StreamReader.cs
- Pen.cs