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
- RoleGroupCollection.cs
- SqlFunctionAttribute.cs
- OperationPerformanceCounters.cs
- Version.cs
- InternalResources.cs
- BindingGraph.cs
- XPathNavigatorReader.cs
- SystemIPv4InterfaceProperties.cs
- ContractValidationHelper.cs
- DesignerView.Commands.cs
- SafeLibraryHandle.cs
- AmbientProperties.cs
- StrokeNodeData.cs
- ImageAutomationPeer.cs
- WebBrowserUriTypeConverter.cs
- BaseParser.cs
- NavigationProperty.cs
- AggregationMinMaxHelpers.cs
- XpsFilter.cs
- GridViewSortEventArgs.cs
- ModuleElement.cs
- DataTableReader.cs
- Comparer.cs
- StylusPointProperty.cs
- BypassElement.cs
- CodeTypeReferenceCollection.cs
- BuilderPropertyEntry.cs
- ReaderWriterLock.cs
- LicenseContext.cs
- DesignSurfaceCollection.cs
- FastEncoder.cs
- DetailsViewUpdatedEventArgs.cs
- TCEAdapterGenerator.cs
- PeerNearMe.cs
- DataGridViewCellCollection.cs
- WebBrowserHelper.cs
- BitmapImage.cs
- SplashScreenNativeMethods.cs
- DataGridViewTopLeftHeaderCell.cs
- ObjectView.cs
- SmiConnection.cs
- SHA256Managed.cs
- DoubleCollectionValueSerializer.cs
- XmlSchemaSimpleContentRestriction.cs
- WindowsTitleBar.cs
- UpdatePanelControlTrigger.cs
- ComponentChangingEvent.cs
- OutgoingWebRequestContext.cs
- CompilerState.cs
- SiteMap.cs
- ExtractorMetadata.cs
- SerializerDescriptor.cs
- SaveFileDialog.cs
- Rectangle.cs
- EnumerableCollectionView.cs
- DirectionalLight.cs
- GradientBrush.cs
- XamlToRtfParser.cs
- BlurEffect.cs
- Viewport2DVisual3D.cs
- CSharpCodeProvider.cs
- OleDbPropertySetGuid.cs
- LayeredChannelFactory.cs
- DataGridViewColumnStateChangedEventArgs.cs
- WindowsFormsDesignerOptionService.cs
- SelectionEditingBehavior.cs
- HitTestFilterBehavior.cs
- EnumConverter.cs
- BrowsableAttribute.cs
- DataContractJsonSerializer.cs
- NegationPusher.cs
- AppDomainManager.cs
- LassoHelper.cs
- Activator.cs
- WindowsListViewGroupSubsetLink.cs
- MouseDevice.cs
- Size3D.cs
- dbenumerator.cs
- HtmlToClrEventProxy.cs
- RuntimeConfigLKG.cs
- RichTextBoxAutomationPeer.cs
- ToolstripProfessionalRenderer.cs
- WebPartMenuStyle.cs
- ChannelServices.cs
- IntSecurity.cs
- CaseInsensitiveComparer.cs
- HttpContext.cs
- TrustLevelCollection.cs
- TextEncodedRawTextWriter.cs
- DateBoldEvent.cs
- sapiproxy.cs
- WindowClosedEventArgs.cs
- XsltException.cs
- InstanceDataCollectionCollection.cs
- SqlConnectionHelper.cs
- FormViewDeleteEventArgs.cs
- TreeChangeInfo.cs
- FontFamily.cs
- GridViewHeaderRowPresenter.cs
- EmitterCache.cs