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
- HttpResponse.cs
- WebConfigurationHost.cs
- DynamicDocumentPaginator.cs
- ClientSettingsProvider.cs
- EventHandlerService.cs
- ObjRef.cs
- XmlSchemaCollection.cs
- MdiWindowListItemConverter.cs
- AttributeCollection.cs
- PermissionSetTriple.cs
- AlternateViewCollection.cs
- CriticalHandle.cs
- invalidudtexception.cs
- ViewStateException.cs
- ExpressionWriter.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ComponentCollection.cs
- SoapCodeExporter.cs
- CompositeActivityTypeDescriptorProvider.cs
- DbProviderFactoriesConfigurationHandler.cs
- WebPartDeleteVerb.cs
- StrokeRenderer.cs
- WebDisplayNameAttribute.cs
- ContainerUIElement3D.cs
- BitmapEffectDrawingContextState.cs
- TextBoxDesigner.cs
- SqlCommand.cs
- AbsoluteQuery.cs
- CompoundFileReference.cs
- DataBindingCollection.cs
- SerializationException.cs
- ThrowHelper.cs
- TypeForwardedToAttribute.cs
- WmlTextBoxAdapter.cs
- Triangle.cs
- Button.cs
- Enlistment.cs
- mediaeventshelper.cs
- TextRange.cs
- StickyNoteContentControl.cs
- SqlDataSourceRefreshSchemaForm.cs
- UserControlFileEditor.cs
- ResourceAttributes.cs
- AssertSection.cs
- SimpleModelProvider.cs
- ComboBox.cs
- RowsCopiedEventArgs.cs
- DataGridCellsPanel.cs
- Win32Exception.cs
- TextParaLineResult.cs
- ComboBox.cs
- DetailsViewModeEventArgs.cs
- ValueQuery.cs
- IItemProperties.cs
- ProcessInfo.cs
- FixedDocumentSequencePaginator.cs
- Menu.cs
- ProfileManager.cs
- TextEndOfParagraph.cs
- WebPartMenu.cs
- Span.cs
- RowToParametersTransformer.cs
- LoginName.cs
- WebPartHelpVerb.cs
- UriTemplatePathPartiallyEquivalentSet.cs
- PagesChangedEventArgs.cs
- AnnotationAdorner.cs
- ObjectDataProvider.cs
- RequestChannelBinder.cs
- RegexMatchCollection.cs
- HtmlTextArea.cs
- _PooledStream.cs
- ProcessProtocolHandler.cs
- DetailsViewDeletedEventArgs.cs
- ProtocolImporter.cs
- sqlmetadatafactory.cs
- TextStore.cs
- RootBrowserWindowAutomationPeer.cs
- FakeModelItemImpl.cs
- VoiceObjectToken.cs
- XmlSignatureManifest.cs
- DEREncoding.cs
- OracleCommand.cs
- XPathDocumentBuilder.cs
- TraceListeners.cs
- FixedPosition.cs
- GridViewUpdateEventArgs.cs
- MailAddress.cs
- MimeTextImporter.cs
- DecoderNLS.cs
- ObjectStateManager.cs
- XmlWrappingReader.cs
- sapiproxy.cs
- AttributeData.cs
- SizeKeyFrameCollection.cs
- DataGridDesigner.cs
- CatchBlock.cs
- CombinedTcpChannel.cs
- CustomTypeDescriptor.cs
- KeysConverter.cs