Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / SocketException.cs / 5 / SocketException.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Sockets { using System; using System.ComponentModel; using System.Runtime.Serialization; using System.Runtime.InteropServices; ////// [Serializable] public class SocketException : Win32Exception { [NonSerialized] private EndPoint m_EndPoint; ////// Provides socket exceptions to the application. /// ////// public SocketException() : base(Marshal.GetLastWin32Error()) { GlobalLog.Print("SocketException::.ctor() " + NativeErrorCode.ToString() + ":" + Message); } internal SocketException(EndPoint endPoint) : base(Marshal.GetLastWin32Error()) { m_EndPoint = endPoint; } ////// Creates a new instance of the ///class with the default error code. /// /// public SocketException(int errorCode) : base(errorCode) { GlobalLog.Print("SocketException::.ctor(int) " + NativeErrorCode.ToString() + ":" + Message); } internal SocketException(int errorCode, EndPoint endPoint) : base(errorCode) { m_EndPoint = endPoint; } ////// Creates a new instance of the ///class with the specified error code. /// /// internal SocketException(SocketError socketError) : base((int)socketError) { } protected SocketException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) { GlobalLog.Print("SocketException::.ctor(serialized) " + NativeErrorCode.ToString() + ":" + Message); } ////// Creates a new instance of the ///class with the specified error code as SocketError. /// /// public override int ErrorCode { // // the base class returns the HResult with this property // we need the Win32 Error Code, hence the override. // get { return NativeErrorCode; } } public override string Message { get { // If not null add EndPoint.ToString() to end of base Message if (m_EndPoint == null) { return base.Message; } else { return base.Message + " " + m_EndPoint.ToString(); } } } public SocketError SocketErrorCode { // // the base class returns the HResult with this property // we need the Win32 Error Code, hence the override. // get { return (SocketError)NativeErrorCode; } } }; // class SocketException } // namespace System.Net // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //[To be supplied.] ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Sockets { using System; using System.ComponentModel; using System.Runtime.Serialization; using System.Runtime.InteropServices; ////// [Serializable] public class SocketException : Win32Exception { [NonSerialized] private EndPoint m_EndPoint; ////// Provides socket exceptions to the application. /// ////// public SocketException() : base(Marshal.GetLastWin32Error()) { GlobalLog.Print("SocketException::.ctor() " + NativeErrorCode.ToString() + ":" + Message); } internal SocketException(EndPoint endPoint) : base(Marshal.GetLastWin32Error()) { m_EndPoint = endPoint; } ////// Creates a new instance of the ///class with the default error code. /// /// public SocketException(int errorCode) : base(errorCode) { GlobalLog.Print("SocketException::.ctor(int) " + NativeErrorCode.ToString() + ":" + Message); } internal SocketException(int errorCode, EndPoint endPoint) : base(errorCode) { m_EndPoint = endPoint; } ////// Creates a new instance of the ///class with the specified error code. /// /// internal SocketException(SocketError socketError) : base((int)socketError) { } protected SocketException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) { GlobalLog.Print("SocketException::.ctor(serialized) " + NativeErrorCode.ToString() + ":" + Message); } ////// Creates a new instance of the ///class with the specified error code as SocketError. /// /// public override int ErrorCode { // // the base class returns the HResult with this property // we need the Win32 Error Code, hence the override. // get { return NativeErrorCode; } } public override string Message { get { // If not null add EndPoint.ToString() to end of base Message if (m_EndPoint == null) { return base.Message; } else { return base.Message + " " + m_EndPoint.ToString(); } } } public SocketError SocketErrorCode { // // the base class returns the HResult with this property // we need the Win32 Error Code, hence the override. // get { return (SocketError)NativeErrorCode; } } }; // class SocketException } // namespace System.Net // File provided for Reference Use Only by Microsoft Corporation (c) 2007.[To be supplied.] ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OLEDB_Enum.cs
- DataGridViewCheckBoxCell.cs
- SystemEvents.cs
- XPathDocumentBuilder.cs
- EventPrivateKey.cs
- BindingOperations.cs
- ExclusiveCanonicalizationTransform.cs
- ResolvedKeyFrameEntry.cs
- NativeMethods.cs
- IdentityVerifier.cs
- QueryExtender.cs
- Int32RectValueSerializer.cs
- RenderData.cs
- WebConfigurationManager.cs
- WorkflowServiceHostFactory.cs
- DefaultProfileManager.cs
- DecoderNLS.cs
- GeometryCollection.cs
- SectionInformation.cs
- ProfileManager.cs
- WebPartDeleteVerb.cs
- SqlCacheDependencyDatabase.cs
- _ListenerAsyncResult.cs
- WorkflowEnvironment.cs
- EventQueueState.cs
- NotSupportedException.cs
- WindowsFormsDesignerOptionService.cs
- OutputCacheModule.cs
- ChangeBlockUndoRecord.cs
- Registry.cs
- ClientSession.cs
- MsmqTransportElement.cs
- ISFTagAndGuidCache.cs
- Vector3DAnimation.cs
- QueryExpr.cs
- WebServiceErrorEvent.cs
- DependencyPropertyHelper.cs
- SdlChannelSink.cs
- ListViewContainer.cs
- UnlockCardRequest.cs
- TextServicesDisplayAttribute.cs
- Persist.cs
- TextCollapsingProperties.cs
- Char.cs
- ColorContext.cs
- RenamedEventArgs.cs
- ListBoxItemAutomationPeer.cs
- SystemIPGlobalProperties.cs
- DataSourceControl.cs
- RankException.cs
- WindowsStatusBar.cs
- IntranetCredentialPolicy.cs
- ParseChildrenAsPropertiesAttribute.cs
- PolicyException.cs
- Authorization.cs
- XPathDocumentNavigator.cs
- WindowsGraphicsCacheManager.cs
- ElementFactory.cs
- Line.cs
- Compiler.cs
- XmlElement.cs
- WCFModelStrings.Designer.cs
- SafeMarshalContext.cs
- MembershipValidatePasswordEventArgs.cs
- NativeCppClassAttribute.cs
- DomainUpDown.cs
- CellConstant.cs
- UrlMappingsModule.cs
- ArcSegment.cs
- Vector3DAnimationBase.cs
- TextFormatterContext.cs
- SiteMapNodeCollection.cs
- WasHttpHandlersInstallComponent.cs
- BufferedGraphicsContext.cs
- TransformCollection.cs
- IMembershipProvider.cs
- DesignerActionUI.cs
- DoubleCollection.cs
- ComponentResourceManager.cs
- autovalidator.cs
- PathSegmentCollection.cs
- CatalogPartCollection.cs
- PrivilegedConfigurationManager.cs
- PauseStoryboard.cs
- Transaction.cs
- FormViewPageEventArgs.cs
- EmbeddedObject.cs
- RsaSecurityToken.cs
- HttpRequestCacheValidator.cs
- PartialCachingAttribute.cs
- PerformanceCounterPermissionAttribute.cs
- DataColumnMapping.cs
- RuleRefElement.cs
- IPEndPointCollection.cs
- EntityConnection.cs
- Coordinator.cs
- ShapeTypeface.cs
- HtmlContainerControl.cs
- LocatorBase.cs
- AtomicFile.cs