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
- ObjectStateEntry.cs
- NameSpaceExtractor.cs
- LiteralDesigner.cs
- DataGridCellClipboardEventArgs.cs
- TriggerActionCollection.cs
- KeyValuePairs.cs
- DataGridViewCellLinkedList.cs
- DateTimeOffsetStorage.cs
- DataRowCollection.cs
- CannotUnloadAppDomainException.cs
- PointLightBase.cs
- Interop.cs
- HostingEnvironmentSection.cs
- SqlWriter.cs
- FloaterBaseParagraph.cs
- BaseCAMarshaler.cs
- PlainXmlSerializer.cs
- securitymgrsite.cs
- GeneratedContractType.cs
- DbMetaDataCollectionNames.cs
- DataFieldConverter.cs
- DataGridClipboardCellContent.cs
- CodeSnippetTypeMember.cs
- SearchForVirtualItemEventArgs.cs
- XPathBinder.cs
- CodeSnippetExpression.cs
- SiteIdentityPermission.cs
- ScrollContentPresenter.cs
- BasicSecurityProfileVersion.cs
- GenericTextProperties.cs
- TextSelection.cs
- ComponentResourceKey.cs
- WebServiceClientProxyGenerator.cs
- BamlResourceContent.cs
- OperationAbortedException.cs
- AsymmetricKeyExchangeDeformatter.cs
- MarkupCompilePass2.cs
- DbTransaction.cs
- PasswordDeriveBytes.cs
- SiteMapSection.cs
- ModelItemCollection.cs
- XmlComplianceUtil.cs
- FileNotFoundException.cs
- SafeUserTokenHandle.cs
- RoleManagerEventArgs.cs
- TypeNameParser.cs
- Stylus.cs
- SelectionRangeConverter.cs
- CharKeyFrameCollection.cs
- ExplicitDiscriminatorMap.cs
- SettingsSavedEventArgs.cs
- RadioButton.cs
- CqlGenerator.cs
- SamlAuthenticationClaimResource.cs
- BoundColumn.cs
- MediaPlayer.cs
- BuilderPropertyEntry.cs
- BaseTemplateBuildProvider.cs
- WebBrowserNavigatedEventHandler.cs
- DescendantOverDescendantQuery.cs
- HttpCachePolicyBase.cs
- MarkedHighlightComponent.cs
- Nullable.cs
- WebConfigurationHost.cs
- ModifierKeysValueSerializer.cs
- DataRecord.cs
- SystemIcmpV4Statistics.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- AtlasWeb.Designer.cs
- StorageAssociationSetMapping.cs
- TableRowCollection.cs
- MiniModule.cs
- GeneralTransform3DCollection.cs
- UmAlQuraCalendar.cs
- WorkflowDebuggerSteppingAttribute.cs
- Message.cs
- CodeGeneratorOptions.cs
- SignerInfo.cs
- BitmapMetadata.cs
- ModifiableIteratorCollection.cs
- PasswordTextNavigator.cs
- WebBrowserPermission.cs
- TypeLibraryHelper.cs
- Maps.cs
- ProfileManager.cs
- Brush.cs
- NamespaceQuery.cs
- EntityDataSourceViewSchema.cs
- Bold.cs
- Compensate.cs
- InstanceCreationEditor.cs
- Int32AnimationBase.cs
- LowerCaseStringConverter.cs
- IndexedSelectQueryOperator.cs
- ThreadSafeList.cs
- ControllableStoryboardAction.cs
- SqlHelper.cs
- AbstractDataSvcMapFileLoader.cs
- ListSurrogate.cs
- HttpDebugHandler.cs