Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / SocketException.cs / 2 / 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[To be supplied.] ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StreamDocument.cs
- AuthorizationSection.cs
- InvalidDataException.cs
- XmlDomTextWriter.cs
- IgnoreFlushAndCloseStream.cs
- PointCollection.cs
- ObjectTokenCategory.cs
- TypeDelegator.cs
- AssemblyAttributes.cs
- PrivilegedConfigurationManager.cs
- DynamicValueConverter.cs
- TabPageDesigner.cs
- XmlNavigatorStack.cs
- XmlUrlResolver.cs
- NullableFloatSumAggregationOperator.cs
- WebEventCodes.cs
- UrlAuthorizationModule.cs
- Compress.cs
- SqlDuplicator.cs
- RegexRunnerFactory.cs
- SqlDataRecord.cs
- WindowsFormsSectionHandler.cs
- SqlVisitor.cs
- OdbcConnectionOpen.cs
- XmlParserContext.cs
- TrackingProfileSerializer.cs
- WebPartEditorApplyVerb.cs
- Style.cs
- IPCCacheManager.cs
- RemoteWebConfigurationHostStream.cs
- FtpCachePolicyElement.cs
- IdentityReference.cs
- ResourceWriter.cs
- MissingFieldException.cs
- ExtensibleClassFactory.cs
- FormViewDesigner.cs
- PasswordPropertyTextAttribute.cs
- Grant.cs
- NamedElement.cs
- Size3DConverter.cs
- FillBehavior.cs
- MULTI_QI.cs
- DayRenderEvent.cs
- SmtpMail.cs
- StringConcat.cs
- ScriptingWebServicesSectionGroup.cs
- CodeMemberField.cs
- TextBreakpoint.cs
- Mapping.cs
- StartUpEventArgs.cs
- Menu.cs
- RemotingSurrogateSelector.cs
- TiffBitmapDecoder.cs
- HasCopySemanticsAttribute.cs
- DataGridViewCellStyleBuilderDialog.cs
- Utils.cs
- XmlAttributeHolder.cs
- Activator.cs
- WebContentFormatHelper.cs
- AutomationPeer.cs
- DiffuseMaterial.cs
- VisualStateChangedEventArgs.cs
- TeredoHelper.cs
- ComPlusDiagnosticTraceSchemas.cs
- DependencyPropertyHelper.cs
- UntypedNullExpression.cs
- FixedHighlight.cs
- EntityClientCacheKey.cs
- SequenceNumber.cs
- Rotation3D.cs
- TextRenderingModeValidation.cs
- Asn1IntegerConverter.cs
- ByteStack.cs
- LoginView.cs
- XamlSerializerUtil.cs
- QilInvokeLateBound.cs
- ResourceManager.cs
- EventMappingSettings.cs
- EntityRecordInfo.cs
- Material.cs
- TransformGroup.cs
- XmlDigitalSignatureProcessor.cs
- SQLByte.cs
- Model3DGroup.cs
- HtmlTextArea.cs
- GestureRecognizer.cs
- Frame.cs
- UrlPath.cs
- SQLGuid.cs
- Marshal.cs
- TextElementCollectionHelper.cs
- SignatureToken.cs
- NotifyCollectionChangedEventArgs.cs
- ElementAtQueryOperator.cs
- AnnotationDocumentPaginator.cs
- Relationship.cs
- ChtmlTextWriter.cs
- SchemaCollectionCompiler.cs
- ApplicationCommands.cs