Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Net / System / Net / SocketException.cs / 1 / 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
- MimeWriter.cs
- EntitySet.cs
- SoapRpcServiceAttribute.cs
- DivideByZeroException.cs
- Timer.cs
- NavigationProgressEventArgs.cs
- WebPartsSection.cs
- lengthconverter.cs
- StrokeCollection2.cs
- SyntaxCheck.cs
- ValidatorCollection.cs
- SerializationBinder.cs
- EventLogEntryCollection.cs
- ExpressionEditorAttribute.cs
- ByteAnimationBase.cs
- DataSourceSelectArguments.cs
- WinEventWrap.cs
- BitmapEffect.cs
- ProvidersHelper.cs
- ApplicationFileCodeDomTreeGenerator.cs
- Profiler.cs
- PageCatalogPart.cs
- ConfigErrorGlyph.cs
- LineVisual.cs
- DataBoundControlActionList.cs
- VisualBrush.cs
- RangeValuePattern.cs
- VisualBrush.cs
- DataGridComponentEditor.cs
- TextElementEditingBehaviorAttribute.cs
- InternalDuplexBindingElement.cs
- XmlNavigatorStack.cs
- TypeValidationEventArgs.cs
- XmlSchemaGroup.cs
- MediaScriptCommandRoutedEventArgs.cs
- DockPanel.cs
- CodeGroup.cs
- RegexWriter.cs
- XmlStringTable.cs
- Scene3D.cs
- EditorZone.cs
- BufferedConnection.cs
- WindowsStatic.cs
- NameValueCollection.cs
- RelationshipEndMember.cs
- Int16Animation.cs
- WebPartZoneDesigner.cs
- DetailsViewPagerRow.cs
- JobPageOrder.cs
- EditorPartCollection.cs
- CryptoConfig.cs
- FixedMaxHeap.cs
- SqlConnectionString.cs
- dsa.cs
- AuthenticationModuleElement.cs
- FileRecordSequenceHelper.cs
- ComponentRenameEvent.cs
- SuppressMessageAttribute.cs
- FormViewDeleteEventArgs.cs
- ListContractAdapter.cs
- LinearKeyFrames.cs
- SqlDataSourceQuery.cs
- Merger.cs
- DataGridViewButtonColumn.cs
- TypeDependencyAttribute.cs
- UnlockInstanceCommand.cs
- WebPartDisplayModeCollection.cs
- HtmlAnchor.cs
- SByteStorage.cs
- AttachedPropertyMethodSelector.cs
- LayoutUtils.cs
- TimeSpanStorage.cs
- HideDisabledControlAdapter.cs
- PageWrapper.cs
- ProcessHostMapPath.cs
- ISAPIRuntime.cs
- ImageCreator.cs
- HwndStylusInputProvider.cs
- Literal.cs
- DataGridViewImageColumn.cs
- LifetimeServices.cs
- Delay.cs
- XmlCompatibilityReader.cs
- SessionPageStateSection.cs
- RTLAwareMessageBox.cs
- WindowClosedEventArgs.cs
- FontFaceLayoutInfo.cs
- OracleCommand.cs
- CollectionEditVerbManager.cs
- CaseCqlBlock.cs
- XmlDataFileEditor.cs
- SimpleLine.cs
- ScrollProperties.cs
- GridViewEditEventArgs.cs
- TraceData.cs
- SiteMapDataSource.cs
- ResXDataNode.cs
- JpegBitmapEncoder.cs
- HttpHostedTransportConfiguration.cs
- DataServiceClientException.cs