Code:
/ DotNET / DotNET / 8.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
- ScriptMethodAttribute.cs
- EventLogEntryCollection.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- SpeechDetectedEventArgs.cs
- ProxyWebPart.cs
- DataPagerField.cs
- ResourceSetExpression.cs
- TypeElement.cs
- GridViewAutoFormat.cs
- CultureInfo.cs
- CqlParser.cs
- TagPrefixAttribute.cs
- DecodeHelper.cs
- RawStylusInput.cs
- XamlStackWriter.cs
- EntityDataSourceDesigner.cs
- HeaderUtility.cs
- Random.cs
- ControlBuilderAttribute.cs
- Parameter.cs
- InstanceContextManager.cs
- EnumerableWrapperWeakToStrong.cs
- DataBoundControlParameterTarget.cs
- OleAutBinder.cs
- SqlRowUpdatedEvent.cs
- Message.cs
- PropertyValidationContext.cs
- PassportIdentity.cs
- ContainerAction.cs
- OdbcTransaction.cs
- DiscoveryMessageProperty.cs
- KeyPressEvent.cs
- RequestCache.cs
- cookiecollection.cs
- FileRegion.cs
- FontFamilyIdentifier.cs
- HtmlInputControl.cs
- EntryIndex.cs
- GridLength.cs
- DbModificationCommandTree.cs
- XamlFigureLengthSerializer.cs
- NonPrimarySelectionGlyph.cs
- AppDomainAttributes.cs
- RegisteredDisposeScript.cs
- FixedSOMPageElement.cs
- AdapterUtil.cs
- ProcessModule.cs
- WorkerRequest.cs
- RSAOAEPKeyExchangeFormatter.cs
- GeneralTransform2DTo3DTo2D.cs
- RunInstallerAttribute.cs
- MetadataItemSerializer.cs
- XDRSchema.cs
- LOSFormatter.cs
- __ConsoleStream.cs
- RuntimeHandles.cs
- XhtmlBasicValidatorAdapter.cs
- DataGridRow.cs
- TiffBitmapEncoder.cs
- GenerateScriptTypeAttribute.cs
- DesignerRegion.cs
- CollectionTraceRecord.cs
- SchemaComplexType.cs
- Automation.cs
- COM2Properties.cs
- BitmapEffectGeneralTransform.cs
- JsonFormatGeneratorStatics.cs
- MappingItemCollection.cs
- TableLayoutStyleCollection.cs
- SrgsElementFactoryCompiler.cs
- File.cs
- PrintControllerWithStatusDialog.cs
- Add.cs
- MatrixAnimationUsingPath.cs
- WindowsToolbarItemAsMenuItem.cs
- SmtpFailedRecipientException.cs
- TransformerInfo.cs
- EmptyStringExpandableObjectConverter.cs
- StackBuilderSink.cs
- ClassicBorderDecorator.cs
- XXXInfos.cs
- SafeTimerHandle.cs
- SspiSafeHandles.cs
- WorkflowPersistenceContext.cs
- TemplateControlCodeDomTreeGenerator.cs
- ComponentEvent.cs
- ExpressionConverter.cs
- TextBoxBase.cs
- HtmlTable.cs
- Query.cs
- parserscommon.cs
- ToolStripSettings.cs
- DispatcherExceptionEventArgs.cs
- LinearGradientBrush.cs
- SchemaImporterExtension.cs
- BlurEffect.cs
- sqlnorm.cs
- XmlSerializationWriter.cs
- BindToObject.cs
- HandleCollector.cs