Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / DnsEndPoint.cs / 1305376 / DnsEndPoint.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Net.Sockets; namespace System.Net { public class DnsEndPoint : EndPoint { private string m_Host; private int m_Port; private AddressFamily m_Family; public DnsEndPoint(string host, int port) : this(host, port, AddressFamily.Unspecified) {} public DnsEndPoint(string host, int port, AddressFamily addressFamily) { if(host == null) { throw new ArgumentNullException("host"); } if (String.IsNullOrEmpty(host)) { throw new ArgumentException(SR.GetString(SR.net_emptystringcall, "host")); } if(port < IPEndPoint.MinPort || port > IPEndPoint.MaxPort) { throw new ArgumentOutOfRangeException("port"); } if (addressFamily != AddressFamily.InterNetwork && addressFamily != AddressFamily.InterNetworkV6 && addressFamily != AddressFamily.Unspecified) { throw new ArgumentException(SR.GetString(SR.net_sockets_invalid_optionValue_all), "addressFamily"); } m_Host = host; m_Port = port; m_Family = addressFamily; } public override bool Equals(object comparand) { DnsEndPoint dnsComparand = comparand as DnsEndPoint; if (dnsComparand == null) return false; return (m_Family == dnsComparand.m_Family && m_Port == dnsComparand.m_Port && m_Host == dnsComparand.m_Host); } public override int GetHashCode() { return StringComparer.InvariantCultureIgnoreCase.GetHashCode(ToString()); } public override string ToString() { return m_Family + "/" + m_Host + ":" + m_Port; } public string Host { get { return m_Host; } } public override AddressFamily AddressFamily { get { return m_Family; } } public int Port { get { return m_Port; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PackWebRequest.cs
- RequestCachePolicy.cs
- ButtonChrome.cs
- DesignerActionUIService.cs
- ToolStripDesigner.cs
- DefaultShape.cs
- Slider.cs
- BamlLocalizableResourceKey.cs
- HttpAsyncResult.cs
- DateBoldEvent.cs
- ConstNode.cs
- SafeNativeMethods.cs
- CFStream.cs
- SoapSchemaImporter.cs
- RequestCachePolicyConverter.cs
- PropertyEmitter.cs
- coordinatorscratchpad.cs
- AnnotationComponentChooser.cs
- DocumentReferenceCollection.cs
- _AutoWebProxyScriptWrapper.cs
- TextDecorations.cs
- InvariantComparer.cs
- StorageMappingFragment.cs
- EnumerableRowCollectionExtensions.cs
- DriveInfo.cs
- CustomError.cs
- ConfigXmlCDataSection.cs
- BindingSource.cs
- Geometry.cs
- DesignTimeTemplateParser.cs
- HideDisabledControlAdapter.cs
- AnnotationResourceChangedEventArgs.cs
- InfiniteIntConverter.cs
- ResourceReader.cs
- UnauthorizedAccessException.cs
- ObjectAssociationEndMapping.cs
- Matrix3D.cs
- ReferenceEqualityComparer.cs
- XmlEventCache.cs
- DSACryptoServiceProvider.cs
- ValidationHelper.cs
- SelectionListComponentEditor.cs
- Section.cs
- PersonalizableAttribute.cs
- Int16KeyFrameCollection.cs
- SqlDataSourceCache.cs
- RepeatBehavior.cs
- SemaphoreSecurity.cs
- WorkflowHostingResponseContext.cs
- ExtensionWindowHeader.cs
- regiisutil.cs
- BaseInfoTable.cs
- HandlerElement.cs
- Int64KeyFrameCollection.cs
- MultiTouchSystemGestureLogic.cs
- XmlSchemaFacet.cs
- TargetConverter.cs
- MediaScriptCommandRoutedEventArgs.cs
- DomainUpDown.cs
- DictionaryMarkupSerializer.cs
- StylusDownEventArgs.cs
- TextEditorLists.cs
- IDReferencePropertyAttribute.cs
- ConsumerConnectionPointCollection.cs
- ZipFileInfo.cs
- PhysicalOps.cs
- TextDecorationCollection.cs
- XmlSchemaObjectTable.cs
- DefaultCommandExtensionCallback.cs
- DocumentViewerAutomationPeer.cs
- HtmlTitle.cs
- ExecutionContext.cs
- ContractsBCL.cs
- Scripts.cs
- Expression.cs
- PriorityBindingExpression.cs
- AutomationFocusChangedEventArgs.cs
- XmlObjectSerializerWriteContextComplex.cs
- userdatakeys.cs
- SecurityKeyIdentifier.cs
- DoubleSumAggregationOperator.cs
- ZoneLinkButton.cs
- GenericTypeParameterConverter.cs
- XPathArrayIterator.cs
- SafeWaitHandle.cs
- PartialClassGenerationTask.cs
- DbCommandDefinition.cs
- TableLayoutPanel.cs
- RowBinding.cs
- Misc.cs
- InputEventArgs.cs
- PageAsyncTask.cs
- ResXResourceSet.cs
- MemoryMappedView.cs
- FtpWebRequest.cs
- EventDescriptor.cs
- RowToFieldTransformer.cs
- BitmapCacheBrush.cs
- XmlNodeList.cs
- WindowsStatusBar.cs