Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / SocketException.cs / 1305376 / 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
- ResourceReader.cs
- TextSegment.cs
- AxisAngleRotation3D.cs
- ResolveMatchesMessageCD1.cs
- TypeBuilder.cs
- Preprocessor.cs
- Column.cs
- ItemMap.cs
- LambdaCompiler.Unary.cs
- DropSource.cs
- SortKey.cs
- TextTreeUndo.cs
- ExpressionReplacer.cs
- AssemblyBuilderData.cs
- _ContextAwareResult.cs
- BitmapMetadataEnumerator.cs
- BaseDataListDesigner.cs
- AdCreatedEventArgs.cs
- DataBindingCollection.cs
- ClientCredentialsElement.cs
- ContextMenu.cs
- StaticContext.cs
- ConditionCollection.cs
- TableRowGroupCollection.cs
- HtmlWindow.cs
- BitmapEffectInputData.cs
- TypeNameConverter.cs
- Interlocked.cs
- GlyphRun.cs
- JpegBitmapDecoder.cs
- X509AsymmetricSecurityKey.cs
- QueryOperator.cs
- Opcode.cs
- XmlMapping.cs
- InkCanvasSelection.cs
- Util.cs
- XmlRootAttribute.cs
- SqlColumnizer.cs
- NameTable.cs
- TreeViewImageIndexConverter.cs
- Condition.cs
- TypeEnumerableViewSchema.cs
- OverflowException.cs
- Parser.cs
- MultiBindingExpression.cs
- NonVisualControlAttribute.cs
- FormsAuthentication.cs
- COM2ExtendedBrowsingHandler.cs
- ArraySegment.cs
- InputBindingCollection.cs
- ProfileGroupSettings.cs
- IndexOutOfRangeException.cs
- HtmlTextArea.cs
- GZipUtils.cs
- SRGSCompiler.cs
- SmtpAuthenticationManager.cs
- StorageComplexPropertyMapping.cs
- CheckPair.cs
- DeriveBytes.cs
- AutoResetEvent.cs
- DefaultEventAttribute.cs
- DateTimeConverter.cs
- OrderPreservingPipeliningMergeHelper.cs
- Binding.cs
- SqlDataSourceFilteringEventArgs.cs
- Menu.cs
- ToolbarAUtomationPeer.cs
- ConfigurationStrings.cs
- ConfigLoader.cs
- ILGen.cs
- CompilationUnit.cs
- PaginationProgressEventArgs.cs
- ImageAutomationPeer.cs
- ItemContainerGenerator.cs
- ObjectStateManagerMetadata.cs
- MemoryRecordBuffer.cs
- RelationshipFixer.cs
- DataGrid.cs
- FormViewRow.cs
- XslVisitor.cs
- NavigatorInput.cs
- MiniAssembly.cs
- AstTree.cs
- Stack.cs
- MimeObjectFactory.cs
- ImageSource.cs
- DesignerGeometryHelper.cs
- HandleExceptionArgs.cs
- EntityDataSourceStatementEditor.cs
- Gdiplus.cs
- ProgressPage.cs
- ProcessHost.cs
- ListViewDataItem.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- ToolStripContainer.cs
- AuthenticationSection.cs
- DoWorkEventArgs.cs
- PtsHelper.cs
- TextMessageEncodingBindingElement.cs
- ManualResetEvent.cs