Code:
/ FX-1434 / FX-1434 / 1.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
- CardSpaceSelector.cs
- SigningCredentials.cs
- cookieexception.cs
- TriggerCollection.cs
- ToggleButton.cs
- AbstractExpressions.cs
- MappingModelBuildProvider.cs
- MaskInputRejectedEventArgs.cs
- StatusBarAutomationPeer.cs
- Light.cs
- CfgArc.cs
- MethodRental.cs
- XamlFigureLengthSerializer.cs
- Span.cs
- BindingList.cs
- StringFunctions.cs
- TraceListeners.cs
- Graphics.cs
- SplashScreenNativeMethods.cs
- ReceiveParametersContent.cs
- XmlSchemaSimpleTypeUnion.cs
- HttpContext.cs
- PrtCap_Public_Simple.cs
- Msec.cs
- StatusBarPanelClickEvent.cs
- EncryptedKeyIdentifierClause.cs
- XmlNodeReader.cs
- MouseDevice.cs
- AnyReturnReader.cs
- IApplicationTrustManager.cs
- Shared.cs
- DataServiceQueryOfT.cs
- EventProviderWriter.cs
- ParserContext.cs
- HostingPreferredMapPath.cs
- SamlSecurityTokenAuthenticator.cs
- EdmComplexPropertyAttribute.cs
- CorrelationExtension.cs
- AbandonedMutexException.cs
- SchemaCompiler.cs
- ExtendedProtectionPolicy.cs
- RunInstallerAttribute.cs
- SessionSwitchEventArgs.cs
- TemplateControlParser.cs
- EntitySet.cs
- MaskInputRejectedEventArgs.cs
- ProtocolsInstallComponent.cs
- FactorySettingsElement.cs
- CodeDOMProvider.cs
- HostSecurityManager.cs
- XPathEmptyIterator.cs
- Atom10FormatterFactory.cs
- EntityChangedParams.cs
- InstanceDescriptor.cs
- ProviderCommandInfoUtils.cs
- ObservableDictionary.cs
- OptimalTextSource.cs
- XmlExpressionDumper.cs
- DataColumnMapping.cs
- ObjectMemberMapping.cs
- SpellCheck.cs
- ListItemCollection.cs
- XmlName.cs
- XmlSchemaAll.cs
- FigureParagraph.cs
- DataListItemCollection.cs
- HwndSubclass.cs
- MeasureItemEvent.cs
- DataGridViewCellMouseEventArgs.cs
- XmlSchemaCollection.cs
- DrawingServices.cs
- AssemblyResourceLoader.cs
- TreeView.cs
- MultipartContentParser.cs
- BamlMapTable.cs
- CodeTypeMember.cs
- HashCodeCombiner.cs
- DisposableCollectionWrapper.cs
- DoubleKeyFrameCollection.cs
- returneventsaver.cs
- UsernameTokenFactoryCredential.cs
- MsmqProcessProtocolHandler.cs
- TypeInfo.cs
- EncodingTable.cs
- UnsafeNativeMethods.cs
- TypeContext.cs
- XmlLoader.cs
- NativeMethods.cs
- LogLogRecord.cs
- Codec.cs
- IntegrationExceptionEventArgs.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- XmlRawWriter.cs
- FormsAuthenticationCredentials.cs
- ObjectListCommandsPage.cs
- DataStreamFromComStream.cs
- ComponentEditorPage.cs
- HandlerBase.cs
- BooleanSwitch.cs
- HostedTcpTransportManager.cs