Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / SocketException.cs / 1305376 / 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.] ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- printdlgexmarshaler.cs
- CatalogPartCollection.cs
- DataTemplate.cs
- SoapFault.cs
- ellipse.cs
- BaseInfoTable.cs
- TraceContextEventArgs.cs
- SourceFileBuildProvider.cs
- ReadContentAsBinaryHelper.cs
- SudsParser.cs
- XamlSerializer.cs
- DataSet.cs
- InvalidComObjectException.cs
- DataGridView.cs
- ImageKeyConverter.cs
- DataGridViewCellLinkedList.cs
- UInt64Storage.cs
- RouteItem.cs
- AuthenticationConfig.cs
- InkCanvasAutomationPeer.cs
- StylusLogic.cs
- XmlReader.cs
- CompositionCommandSet.cs
- MouseGesture.cs
- ListBoxItem.cs
- _TimerThread.cs
- ServicesSection.cs
- PathFigureCollectionConverter.cs
- FrameDimension.cs
- ChtmlSelectionListAdapter.cs
- DefaultTraceListener.cs
- SslStream.cs
- WeakEventTable.cs
- DocumentAutomationPeer.cs
- WebRequestModulesSection.cs
- MemberInfoSerializationHolder.cs
- XmlSchemaResource.cs
- SynchronizedDispatch.cs
- HttpApplication.cs
- ControlAdapter.cs
- DbDataReader.cs
- WebEvents.cs
- TableItemPattern.cs
- StandardOleMarshalObject.cs
- ServiceMemoryGates.cs
- StyleTypedPropertyAttribute.cs
- NamespaceList.cs
- OdbcFactory.cs
- WebBrowser.cs
- RadialGradientBrush.cs
- CommandField.cs
- AlignmentXValidation.cs
- SafeNativeMethods.cs
- ObjectTag.cs
- ExtractorMetadata.cs
- rsa.cs
- DataGridHelper.cs
- TextInfo.cs
- BindingSource.cs
- ByteStorage.cs
- BuildManagerHost.cs
- SqlDependency.cs
- xmlfixedPageInfo.cs
- MergeFilterQuery.cs
- PolyBezierSegment.cs
- PingReply.cs
- FixUp.cs
- QueryExpr.cs
- DataGridToolTip.cs
- DatePickerDateValidationErrorEventArgs.cs
- WebServiceTypeData.cs
- SmiMetaData.cs
- DataTableReader.cs
- Rights.cs
- ActivityCodeDomSerializationManager.cs
- Misc.cs
- TableColumn.cs
- ManifestSignedXml.cs
- CoTaskMemHandle.cs
- UserControlParser.cs
- QilStrConcat.cs
- RegistryDataKey.cs
- Cursors.cs
- DbParameterCollection.cs
- HostedElements.cs
- RetriableClipboard.cs
- XmlCustomFormatter.cs
- PartitionResolver.cs
- ImmutableCollection.cs
- CompensatableTransactionScopeActivityDesigner.cs
- InputBinding.cs
- RadioButtonFlatAdapter.cs
- WindowsGraphicsWrapper.cs
- TaskExceptionHolder.cs
- PropertyRecord.cs
- ReadOnlyDataSourceView.cs
- DataMemberListEditor.cs
- TreeView.cs
- Rule.cs
- Pair.cs