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
- ErrorHandlingReceiver.cs
- SqlDependency.cs
- DataGridTable.cs
- NativeMethodsCLR.cs
- VariableAction.cs
- FlowLayout.cs
- returneventsaver.cs
- HtmlMeta.cs
- TogglePattern.cs
- CqlBlock.cs
- Logging.cs
- ToolboxDataAttribute.cs
- TabOrder.cs
- DbTypeMap.cs
- MetadataItemEmitter.cs
- SqlDataSource.cs
- TypedRowGenerator.cs
- Label.cs
- SearchForVirtualItemEventArgs.cs
- AtomEntry.cs
- Int32CollectionValueSerializer.cs
- HostedTcpTransportManager.cs
- EncoderReplacementFallback.cs
- QueryStringConverter.cs
- SerTrace.cs
- Rotation3D.cs
- RadioButtonList.cs
- Menu.cs
- WindowsListViewGroup.cs
- GeometryCollection.cs
- Exceptions.cs
- CommandPlan.cs
- PointF.cs
- ConfigXmlSignificantWhitespace.cs
- DataControlCommands.cs
- TableDetailsRow.cs
- ProcessHostConfigUtils.cs
- ProxyWebPartConnectionCollection.cs
- OptimizedTemplateContentHelper.cs
- ControlIdConverter.cs
- SoapMessage.cs
- TargetInvocationException.cs
- MDIControlStrip.cs
- CqlErrorHelper.cs
- HashMembershipCondition.cs
- SystemWebSectionGroup.cs
- FunctionCommandText.cs
- StatusBarDrawItemEvent.cs
- XsltLibrary.cs
- StructuralType.cs
- NameHandler.cs
- WebPartManagerInternals.cs
- NamedPipeConnectionPoolSettingsElement.cs
- parserscommon.cs
- ChangePassword.cs
- DelegatingStream.cs
- TimeoutStream.cs
- CheckedListBox.cs
- DbTransaction.cs
- StatusBarPanelClickEvent.cs
- WpfXamlLoader.cs
- OAVariantLib.cs
- CodeIdentifier.cs
- PeerResolverSettings.cs
- RootBrowserWindowAutomationPeer.cs
- ToolStripContentPanel.cs
- FontCacheUtil.cs
- WorkflowInvoker.cs
- CompositeTypefaceMetrics.cs
- TaskFactory.cs
- AuthenticationModuleElement.cs
- CreateUserWizardAutoFormat.cs
- HtmlImage.cs
- HttpHandlerAction.cs
- NamespaceQuery.cs
- Point4D.cs
- MergablePropertyAttribute.cs
- _Events.cs
- XmlElementAttribute.cs
- CollectionsUtil.cs
- DataColumnPropertyDescriptor.cs
- Brush.cs
- ManipulationDeltaEventArgs.cs
- oledbconnectionstring.cs
- RegistrySecurity.cs
- SchemaDeclBase.cs
- TextElementEditingBehaviorAttribute.cs
- Processor.cs
- PermissionSetEnumerator.cs
- XsltException.cs
- MailMessageEventArgs.cs
- ProfileSettings.cs
- LiteralTextParser.cs
- BuildManager.cs
- MenuScrollingVisibilityConverter.cs
- HeaderedItemsControl.cs
- BoundingRectTracker.cs
- Merger.cs
- CurrencyManager.cs
- CounterSampleCalculator.cs