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
- DataGridColumnHeaderItemAutomationPeer.cs
- Parser.cs
- WsdlBuildProvider.cs
- Form.cs
- CustomAttributeBuilder.cs
- InvalidProgramException.cs
- Operators.cs
- HotSpot.cs
- NamespaceImport.cs
- ZoneLinkButton.cs
- CodeMemberMethod.cs
- SyntaxCheck.cs
- ClientUrlResolverWrapper.cs
- ComboBoxRenderer.cs
- DateTimeFormatInfoScanner.cs
- EventHandlerList.cs
- DataTableTypeConverter.cs
- WebOperationContext.cs
- PrePrepareMethodAttribute.cs
- MediaCommands.cs
- PerformanceCountersElement.cs
- AttributeConverter.cs
- PropertiesTab.cs
- Pkcs9Attribute.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- HttpCacheParams.cs
- DataBinding.cs
- CodeIndexerExpression.cs
- PerformanceCounterCategory.cs
- CDSsyncETWBCLProvider.cs
- ToolboxComponentsCreatingEventArgs.cs
- RawMouseInputReport.cs
- DataGridViewSelectedCellCollection.cs
- MembershipSection.cs
- TransformerTypeCollection.cs
- MissingSatelliteAssemblyException.cs
- WebResourceUtil.cs
- DocumentGridPage.cs
- WindowsFont.cs
- VersionConverter.cs
- XmlSchemaCompilationSettings.cs
- Image.cs
- LOSFormatter.cs
- TextSyndicationContent.cs
- SafeProcessHandle.cs
- CurrentTimeZone.cs
- VBCodeProvider.cs
- UIHelper.cs
- CodeExpressionStatement.cs
- SqlMethodTransformer.cs
- ExpressionVisitorHelpers.cs
- WindowsAltTab.cs
- Block.cs
- DrawingCollection.cs
- WebPartManagerInternals.cs
- HttpRawResponse.cs
- BitmapImage.cs
- CryptoProvider.cs
- HyperLinkField.cs
- CommonEndpointBehaviorElement.cs
- TypeBuilder.cs
- FilteredAttributeCollection.cs
- FunctionGenerator.cs
- ExecutionEngineException.cs
- HelloOperation11AsyncResult.cs
- ResourceManager.cs
- OperandQuery.cs
- HtmlInputSubmit.cs
- DateBoldEvent.cs
- CheckBoxList.cs
- PostBackTrigger.cs
- ControlPager.cs
- ArrayListCollectionBase.cs
- CodeEventReferenceExpression.cs
- DbProviderManifest.cs
- RootNamespaceAttribute.cs
- WasEndpointConfigContainer.cs
- InvalidateEvent.cs
- SRGSCompiler.cs
- securitycriticaldataformultiplegetandset.cs
- DataObjectPastingEventArgs.cs
- KoreanLunisolarCalendar.cs
- Identifier.cs
- ResourceReferenceKeyNotFoundException.cs
- TextOutput.cs
- FrameworkContentElementAutomationPeer.cs
- PopOutPanel.cs
- FrameworkElementAutomationPeer.cs
- ApplicationTrust.cs
- CodeAccessSecurityEngine.cs
- DependencyPropertyAttribute.cs
- LogWriteRestartAreaState.cs
- HttpDebugHandler.cs
- SurrogateEncoder.cs
- GifBitmapEncoder.cs
- XmlSerializerVersionAttribute.cs
- RoutedCommand.cs
- ISAPIRuntime.cs
- DesignBindingPropertyDescriptor.cs
- MapPathBasedVirtualPathProvider.cs