Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- TextParentUndoUnit.cs
- Application.cs
- Authorization.cs
- TransformProviderWrapper.cs
- DataGridViewSortCompareEventArgs.cs
- oledbmetadatacollectionnames.cs
- ZipIORawDataFileBlock.cs
- DataListItemCollection.cs
- WaitForChangedResult.cs
- StaticExtension.cs
- FactoryMaker.cs
- Form.cs
- TabItem.cs
- EntityProviderFactory.cs
- WebPageTraceListener.cs
- InternalTypeHelper.cs
- counter.cs
- ResizingMessageFilter.cs
- TreeNodeBinding.cs
- DataGridItem.cs
- SurrogateEncoder.cs
- SoapAttributes.cs
- Convert.cs
- SQLStringStorage.cs
- HtmlUtf8RawTextWriter.cs
- MarkerProperties.cs
- MatrixUtil.cs
- BaseTemplateParser.cs
- XmlReader.cs
- NativeMethods.cs
- HashStream.cs
- EDesignUtil.cs
- WaitHandleCannotBeOpenedException.cs
- OptimizerPatterns.cs
- SQLDateTimeStorage.cs
- DesignerDataSourceView.cs
- WmfPlaceableFileHeader.cs
- IDispatchConstantAttribute.cs
- ListDependantCardsRequest.cs
- OleDbErrorCollection.cs
- DbDataReader.cs
- SQLDateTime.cs
- FixedSOMLineRanges.cs
- DnsElement.cs
- PrinterUnitConvert.cs
- IsolatedStorageFile.cs
- PixelFormat.cs
- Scalars.cs
- DataSourceCacheDurationConverter.cs
- RowType.cs
- webeventbuffer.cs
- SingleConverter.cs
- HtmlControlPersistable.cs
- SettingsPropertyNotFoundException.cs
- BuildProvider.cs
- RoutingService.cs
- GroupBoxRenderer.cs
- StyleTypedPropertyAttribute.cs
- Resources.Designer.cs
- EntityDataSource.cs
- DeviceContexts.cs
- TextLineBreak.cs
- SettingsAttributes.cs
- ElementHostPropertyMap.cs
- ScalarType.cs
- TableLayoutColumnStyleCollection.cs
- KeyboardEventArgs.cs
- WebPartRestoreVerb.cs
- ApplicationCommands.cs
- SchemaManager.cs
- DateTimePicker.cs
- ListView.cs
- XmlSerializableServices.cs
- CodeStatement.cs
- DeviceFilterDictionary.cs
- InputLanguageEventArgs.cs
- ToolboxSnapDragDropEventArgs.cs
- EnumerableCollectionView.cs
- DbParameterCollection.cs
- SqlCrossApplyToCrossJoin.cs
- DesignOnlyAttribute.cs
- ReaderWriterLockWrapper.cs
- BindingsCollection.cs
- PropertyManager.cs
- WorkflowTimerService.cs
- ClientOptions.cs
- DesignerListAdapter.cs
- PrinterResolution.cs
- SectionInput.cs
- KnownTypes.cs
- QilTypeChecker.cs
- HebrewCalendar.cs
- ActivityInstance.cs
- TextRangeSerialization.cs
- Invariant.cs
- ResourceDescriptionAttribute.cs
- TemplateContainer.cs
- ThreadAbortException.cs
- SkinBuilder.cs
- SHA512Cng.cs