Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / NetworkInformation / SystemTcpConnection.cs / 1 / SystemTcpConnection.cs
namespace System.Net.NetworkInformation { using System.Net; using System.Net.Sockets; using System.Security.Permissions; using System; using System.Runtime.InteropServices; using System.Collections; using System.ComponentModel; using System.Threading; ////// Represents an active Tcp connection. internal class SystemTcpConnectionInformation:TcpConnectionInformation { IPEndPoint localEndPoint; IPEndPoint remoteEndPoint; TcpState state; internal SystemTcpConnectionInformation(MibTcpRow row) { state = row.state; //port is returned in Big-Endian - most significant bit on left //unfortunately, its done at the word level and not the dword level. int localPort = row.localPort3<<24|row.localPort4<<16|row.localPort1<<8|row.localPort2; int remotePort = ((state == TcpState.Listen)?0:row.remotePort3<<24|row.remotePort4<<16|row.remotePort1<<8|row.remotePort2); //need to fix these. Currently they are incorrect if high order bit is set. // uint localPort = (uint)IPAddress.HostToNetworkOrder((short)row.localPort1); // uint remotePort = (uint)IPAddress.HostToNetworkOrder((short)row.remotePort1); localEndPoint = new IPEndPoint(row.localAddr,(int)localPort); remoteEndPoint= new IPEndPoint(row.remoteAddr,(int)remotePort); } public override TcpState State{get {return state;}} public override IPEndPoint LocalEndPoint{get {return localEndPoint;}} public override IPEndPoint RemoteEndPoint{get {return remoteEndPoint;}} } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EnumUnknown.cs
- WmlListAdapter.cs
- Constant.cs
- BitmapEffectInputData.cs
- GeneralTransformGroup.cs
- DbRetry.cs
- ContextStaticAttribute.cs
- LineBreak.cs
- MonitoringDescriptionAttribute.cs
- IISMapPath.cs
- DataControlImageButton.cs
- Application.cs
- ListControlDataBindingHandler.cs
- AuthenticationSection.cs
- DataBindingCollection.cs
- InheritanceContextHelper.cs
- TextDecorationUnitValidation.cs
- NameValueFileSectionHandler.cs
- VectorAnimation.cs
- NetMsmqSecurityElement.cs
- TabItemWrapperAutomationPeer.cs
- MultiPageTextView.cs
- SafeCertificateStore.cs
- CancellationTokenSource.cs
- ProxyHelper.cs
- MexTcpBindingCollectionElement.cs
- Point3D.cs
- CustomWebEventKey.cs
- GroupBoxRenderer.cs
- MSAANativeProvider.cs
- IListConverters.cs
- newinstructionaction.cs
- ACL.cs
- HtmlDocument.cs
- ShaderRenderModeValidation.cs
- NgenServicingAttributes.cs
- TabPageDesigner.cs
- ElementInit.cs
- LogicalExpressionEditor.cs
- BaseCAMarshaler.cs
- XamlToRtfWriter.cs
- RegexCaptureCollection.cs
- EmbeddedMailObjectsCollection.cs
- CodeMemberMethod.cs
- PseudoWebRequest.cs
- PointF.cs
- ToolStripScrollButton.cs
- LeaseManager.cs
- TextParentUndoUnit.cs
- OutArgument.cs
- ProgressBarHighlightConverter.cs
- SynchronizationScope.cs
- ClientScriptManager.cs
- CollectionViewGroupRoot.cs
- UserUseLicenseDictionaryLoader.cs
- SemanticBasicElement.cs
- SerializationException.cs
- IssuedSecurityTokenParameters.cs
- Monitor.cs
- SqlMultiplexer.cs
- ExternalException.cs
- SqlTypeConverter.cs
- compensatingcollection.cs
- ProjectionPathBuilder.cs
- MailMessageEventArgs.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- Mappings.cs
- OperatingSystemVersionCheck.cs
- SafeEventLogReadHandle.cs
- InvalidProgramException.cs
- XmlFormatReaderGenerator.cs
- OleTxTransaction.cs
- DebugView.cs
- Helpers.cs
- latinshape.cs
- ProviderCollection.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- ColorAnimation.cs
- DefaultShape.cs
- NativeMethods.cs
- SerializationTrace.cs
- DiagnosticsConfigurationHandler.cs
- TableProviderWrapper.cs
- EventLogPermissionEntry.cs
- RadioButtonPopupAdapter.cs
- _NTAuthentication.cs
- UiaCoreTypesApi.cs
- LeftCellWrapper.cs
- Visual3DCollection.cs
- GetWinFXPath.cs
- HtmlGenericControl.cs
- ChannelServices.cs
- XsdValidatingReader.cs
- UrlMappingsModule.cs
- EventMappingSettings.cs
- XmlUtf8RawTextWriter.cs
- NamespaceImport.cs
- ICollection.cs
- KeyValueConfigurationElement.cs
- HitTestResult.cs