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
- _ConnectOverlappedAsyncResult.cs
- MobileControlsSectionHandler.cs
- ConfigPathUtility.cs
- ConnectionsZoneDesigner.cs
- PeerToPeerException.cs
- HeaderCollection.cs
- UshortList2.cs
- NamespaceImport.cs
- DependencyPropertyChangedEventArgs.cs
- ParallelTimeline.cs
- SafeEventLogWriteHandle.cs
- QilTargetType.cs
- DoubleCollectionValueSerializer.cs
- StringTraceRecord.cs
- RequestCacheManager.cs
- ContainerVisual.cs
- WorkflowIdleBehavior.cs
- _HeaderInfo.cs
- IImplicitResourceProvider.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- SqlDataReaderSmi.cs
- WebScriptEnablingBehavior.cs
- Codec.cs
- SerializationAttributes.cs
- RequestCachingSection.cs
- SQLResource.cs
- BoolExpression.cs
- Freezable.cs
- StateFinalizationActivity.cs
- SqlCacheDependency.cs
- ResolvedKeyFrameEntry.cs
- IndexedSelectQueryOperator.cs
- TextParagraph.cs
- DataContext.cs
- Buffer.cs
- UnmanagedMemoryStreamWrapper.cs
- CreateCardRequest.cs
- InheritanceAttribute.cs
- DoubleKeyFrameCollection.cs
- CodeDelegateInvokeExpression.cs
- EventProvider.cs
- SqlUserDefinedAggregateAttribute.cs
- OrderingQueryOperator.cs
- ControlHelper.cs
- TextModifierScope.cs
- DataGridViewControlCollection.cs
- MissingMethodException.cs
- DetailsViewInsertEventArgs.cs
- XmlQuerySequence.cs
- ObjectDataSource.cs
- RuntimeConfigLKG.cs
- XPathNavigatorKeyComparer.cs
- ScriptManager.cs
- RoleService.cs
- BufferAllocator.cs
- MulticastIPAddressInformationCollection.cs
- SBCSCodePageEncoding.cs
- DbParameterCollection.cs
- MaskedTextProvider.cs
- BitmapSource.cs
- UserPersonalizationStateInfo.cs
- WmfPlaceableFileHeader.cs
- InfoCardCryptoHelper.cs
- ControlUtil.cs
- WebReferenceCollection.cs
- XmlSchemaAttributeGroup.cs
- HtmlInputFile.cs
- BaseCollection.cs
- BamlLocalizableResource.cs
- SafeRegistryHandle.cs
- Duration.cs
- XmlAnyElementAttribute.cs
- WebBrowserPermission.cs
- Stackframe.cs
- SessionStateItemCollection.cs
- PageContentCollection.cs
- COSERVERINFO.cs
- ControlIdConverter.cs
- ByteConverter.cs
- PageAsyncTask.cs
- StateManagedCollection.cs
- XmlDocumentSerializer.cs
- ReadWriteSpinLock.cs
- OdbcConnectionString.cs
- ButtonChrome.cs
- GridViewCancelEditEventArgs.cs
- HtmlTableRowCollection.cs
- ParallelTimeline.cs
- RectKeyFrameCollection.cs
- ResizeBehavior.cs
- ProxyElement.cs
- WorkflowPageSetupDialog.cs
- MiniCustomAttributeInfo.cs
- TabControlEvent.cs
- HttpCacheVaryByContentEncodings.cs
- MemoryStream.cs
- FloaterBaseParaClient.cs
- IndexedString.cs
- Transform3DGroup.cs
- SchemaNamespaceManager.cs