Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / SocketException.cs / 5 / 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
- SchemaCollectionCompiler.cs
- SqlRowUpdatingEvent.cs
- SQLMembershipProvider.cs
- IdentityReference.cs
- DataSourceCache.cs
- PowerStatus.cs
- Funcletizer.cs
- PrefixQName.cs
- SettingsProviderCollection.cs
- WindowPattern.cs
- X509SubjectKeyIdentifierClause.cs
- VirtualPathProvider.cs
- GridItem.cs
- Unit.cs
- XmlNamespaceMapping.cs
- TypeDefinition.cs
- DecimalAnimation.cs
- PenLineCapValidation.cs
- LinkConverter.cs
- CompareValidator.cs
- Visual3D.cs
- CollectionConverter.cs
- ApplicationFileParser.cs
- BuildManagerHost.cs
- GCHandleCookieTable.cs
- XhtmlTextWriter.cs
- Validator.cs
- ClientRolePrincipal.cs
- HwndSource.cs
- MetadataArtifactLoaderFile.cs
- NativeMethods.cs
- BitmapEffectInputData.cs
- X509CertificateCollection.cs
- FastEncoderWindow.cs
- DataQuery.cs
- CompensatableTransactionScopeActivity.cs
- ItemsPanelTemplate.cs
- RenameRuleObjectDialog.cs
- SchemaMapping.cs
- DotAtomReader.cs
- StringAttributeCollection.cs
- SizeLimitedCache.cs
- InternalBufferManager.cs
- InvalidWMPVersionException.cs
- InputQueue.cs
- FontFamily.cs
- SmtpException.cs
- DataServices.cs
- WebPermission.cs
- TrustLevelCollection.cs
- COM2Properties.cs
- LineBreak.cs
- SafeEventLogWriteHandle.cs
- BamlRecordWriter.cs
- TextEditorTables.cs
- QilXmlWriter.cs
- HttpAsyncResult.cs
- MessagePropertyDescription.cs
- EncodingTable.cs
- UnhandledExceptionEventArgs.cs
- MetafileHeaderWmf.cs
- DataGridViewRowsAddedEventArgs.cs
- DynamicRouteExpression.cs
- ListDictionaryInternal.cs
- ReadWriteObjectLock.cs
- Sequence.cs
- ArrayConverter.cs
- Label.cs
- ApplicationServiceHelper.cs
- NamespaceInfo.cs
- MouseActionValueSerializer.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- EntityWrapper.cs
- RemoteWebConfigurationHostStream.cs
- TextMarkerSource.cs
- TextElementEnumerator.cs
- LookupTables.cs
- Visual3DCollection.cs
- RunInstallerAttribute.cs
- PermissionAttributes.cs
- AtomServiceDocumentSerializer.cs
- DataMisalignedException.cs
- XamlPointCollectionSerializer.cs
- ScriptDescriptor.cs
- AmbientLight.cs
- PrimitiveDataContract.cs
- XPathArrayIterator.cs
- GridViewCellAutomationPeer.cs
- XmlAttributeCollection.cs
- FamilyMap.cs
- FontStyleConverter.cs
- FontStyle.cs
- MulticastOption.cs
- SqlVisitor.cs
- TableAdapterManagerMethodGenerator.cs
- WebPartCatalogCloseVerb.cs
- SqlDataSourceConfigureSortForm.cs
- MarkupExtensionParser.cs
- PropertyAccessVisitor.cs
- BuilderPropertyEntry.cs