Code:
/ DotNET / DotNET / 8.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
- AnnotationComponentChooser.cs
- MutexSecurity.cs
- StringInfo.cs
- DBProviderConfigurationHandler.cs
- TreeViewImageIndexConverter.cs
- NonBatchDirectoryCompiler.cs
- OperationPickerDialog.designer.cs
- SctClaimDictionary.cs
- NavigationPropertyEmitter.cs
- ConfigXmlWhitespace.cs
- Classification.cs
- GridViewCancelEditEventArgs.cs
- TaskForm.cs
- _FtpDataStream.cs
- WindowProviderWrapper.cs
- InputBinder.cs
- SequentialWorkflowRootDesigner.cs
- Int64Converter.cs
- DataStreamFromComStream.cs
- FixedStringLookup.cs
- DataProtection.cs
- InputProcessorProfilesLoader.cs
- ElementUtil.cs
- IndicShape.cs
- QueryAsyncResult.cs
- LineUtil.cs
- IBuiltInEvidence.cs
- DataGridViewMethods.cs
- DataGridViewElement.cs
- StagingAreaInputItem.cs
- ChangeTracker.cs
- DynamicExpression.cs
- SortExpressionBuilder.cs
- TerminatingOperationBehavior.cs
- SettingsProperty.cs
- DataErrorValidationRule.cs
- DesignerOptionService.cs
- StaticResourceExtension.cs
- AsyncOperation.cs
- SoapSchemaExporter.cs
- EndEvent.cs
- CodeMemberEvent.cs
- HttpHandlerActionCollection.cs
- SqlClientWrapperSmiStream.cs
- HtmlFormAdapter.cs
- HierarchicalDataSourceControl.cs
- WindowsStatusBar.cs
- ModelPropertyCollectionImpl.cs
- DescendantQuery.cs
- LiteralText.cs
- AnonymousIdentificationModule.cs
- SiteMapNodeItem.cs
- documentsequencetextcontainer.cs
- ObjectDataSource.cs
- RegexBoyerMoore.cs
- EllipticalNodeOperations.cs
- SourceFileInfo.cs
- TranslateTransform.cs
- PkcsUtils.cs
- SmtpLoginAuthenticationModule.cs
- PtsContext.cs
- SafePEFileHandle.cs
- InvokeWebService.cs
- StaticResourceExtension.cs
- Debugger.cs
- VerificationAttribute.cs
- ThemeDirectoryCompiler.cs
- UnmanagedMarshal.cs
- MultiViewDesigner.cs
- FontWeights.cs
- TrustLevelCollection.cs
- NumberAction.cs
- SyndicationLink.cs
- HostExecutionContextManager.cs
- ComAwareEventInfo.cs
- TextParagraph.cs
- MsmqAuthenticationMode.cs
- PropertyToken.cs
- SystemNetworkInterface.cs
- SeekStoryboard.cs
- DetailsViewActionList.cs
- BitmapEffectvisualstate.cs
- KeyGestureValueSerializer.cs
- MetadataArtifactLoaderResource.cs
- AttributeData.cs
- TransformedBitmap.cs
- InputMethodStateTypeInfo.cs
- RSAPKCS1KeyExchangeFormatter.cs
- TextEffect.cs
- ExtendedPropertyDescriptor.cs
- PointAnimationUsingPath.cs
- AppliedDeviceFiltersEditor.cs
- ValidationHelper.cs
- ObjectListField.cs
- HMAC.cs
- QuaternionAnimation.cs
- PointAnimationBase.cs
- Tuple.cs
- FormatterConverter.cs
- ErrorHandlerModule.cs