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 / SocketException.cs / 1 / 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
- PrePostDescendentsWalker.cs
- DocumentViewerAutomationPeer.cs
- ManagementException.cs
- XmlILModule.cs
- DefaultExpression.cs
- BasePattern.cs
- HintTextMaxWidthConverter.cs
- _AutoWebProxyScriptWrapper.cs
- TextSpanModifier.cs
- StreamWithDictionary.cs
- relpropertyhelper.cs
- ReaderContextStackData.cs
- SafeJobHandle.cs
- MarkupCompiler.cs
- StylusPointDescription.cs
- TransactionOptions.cs
- ListDataHelper.cs
- TextureBrush.cs
- Currency.cs
- ClientProxyGenerator.cs
- mongolianshape.cs
- TimeSpanValidatorAttribute.cs
- CodeDomLoader.cs
- PackWebRequestFactory.cs
- CompilerGeneratedAttribute.cs
- Clipboard.cs
- DesignerTextWriter.cs
- DesigntimeLicenseContext.cs
- DoubleAnimation.cs
- MemberHolder.cs
- LinqToSqlWrapper.cs
- WebServiceBindingAttribute.cs
- File.cs
- ColumnCollection.cs
- HttpPostedFile.cs
- SoapHeaders.cs
- CommentEmitter.cs
- pingexception.cs
- _NativeSSPI.cs
- IriParsingElement.cs
- WebPartManagerInternals.cs
- Label.cs
- ListViewHitTestInfo.cs
- BamlBinaryReader.cs
- SpecularMaterial.cs
- NameValueCollection.cs
- GroupedContextMenuStrip.cs
- TransportContext.cs
- SchemaTypeEmitter.cs
- OutputCacheSettingsSection.cs
- X509Utils.cs
- EmptyEnumerable.cs
- ToolTip.cs
- ExpressionList.cs
- ConversionContext.cs
- URI.cs
- CompilerScopeManager.cs
- SmtpException.cs
- XmlDictionary.cs
- DataTableTypeConverter.cs
- PenContexts.cs
- HttpHandlerActionCollection.cs
- BinaryObjectWriter.cs
- Form.cs
- FixedLineResult.cs
- ParseHttpDate.cs
- HtmlInputText.cs
- DeferredTextReference.cs
- LinkedResourceCollection.cs
- BlurBitmapEffect.cs
- ContextMenuStripGroup.cs
- HTMLTagNameToTypeMapper.cs
- ObjectKeyFrameCollection.cs
- StructuralObject.cs
- Dynamic.cs
- ToggleButton.cs
- ElasticEase.cs
- XpsResource.cs
- TextEncodedRawTextWriter.cs
- ContentOperations.cs
- ComponentRenameEvent.cs
- DetailsViewDeletedEventArgs.cs
- ReflectionServiceProvider.cs
- RootProfilePropertySettingsCollection.cs
- ThreadAttributes.cs
- XmlRootAttribute.cs
- WebAdminConfigurationHelper.cs
- ImageIndexConverter.cs
- PublisherMembershipCondition.cs
- ProfileModule.cs
- XPathDocument.cs
- TreeView.cs
- PenLineCapValidation.cs
- ConnectionPoint.cs
- Rfc2898DeriveBytes.cs
- ResourcesChangeInfo.cs
- MenuAutomationPeer.cs
- WebScriptMetadataInstanceContextProvider.cs
- Point3DValueSerializer.cs
- altserialization.cs