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
- DPTypeDescriptorContext.cs
- StdValidatorsAndConverters.cs
- BindingSource.cs
- SafeArrayTypeMismatchException.cs
- FileEnumerator.cs
- MatcherBuilder.cs
- FloaterBaseParagraph.cs
- PolyBezierSegment.cs
- SubMenuStyleCollection.cs
- ConnectionInterfaceCollection.cs
- PatternMatcher.cs
- SystemIcmpV6Statistics.cs
- CommittableTransaction.cs
- SocketElement.cs
- XmlDeclaration.cs
- NotImplementedException.cs
- TextEditorCopyPaste.cs
- VersionConverter.cs
- ReliableMessagingVersion.cs
- ClassDataContract.cs
- shaperfactoryquerycachekey.cs
- OleDbMetaDataFactory.cs
- DataServiceException.cs
- InputLanguageManager.cs
- COAUTHINFO.cs
- BoundPropertyEntry.cs
- EntityStoreSchemaFilterEntry.cs
- HttpResponseInternalWrapper.cs
- NodeLabelEditEvent.cs
- SiteIdentityPermission.cs
- __FastResourceComparer.cs
- CalendarTable.cs
- SqlDataSourceSummaryPanel.cs
- DBSchemaRow.cs
- WebControlParameterProxy.cs
- PerfService.cs
- WebBrowserEvent.cs
- LogicalExpr.cs
- NameNode.cs
- DbParameterCollectionHelper.cs
- XamlRtfConverter.cs
- IWorkflowDebuggerService.cs
- TypeElement.cs
- StreamResourceInfo.cs
- NativeMethodsOther.cs
- InputEventArgs.cs
- DerivedKeySecurityToken.cs
- DataControlCommands.cs
- RequestCachingSection.cs
- QuaternionKeyFrameCollection.cs
- GZipStream.cs
- BufferModeSettings.cs
- PlanCompilerUtil.cs
- DataGridViewCellCollection.cs
- PerformanceCounterManager.cs
- TextRunTypographyProperties.cs
- InfoCardCryptoHelper.cs
- GridItem.cs
- NullableConverter.cs
- IndexOutOfRangeException.cs
- ConsumerConnectionPoint.cs
- PeerCustomResolverSettings.cs
- StringHandle.cs
- TextSerializer.cs
- EncodingNLS.cs
- coordinatorfactory.cs
- PropertyEmitterBase.cs
- NativeRecognizer.cs
- BitmapCodecInfo.cs
- XmlFormatExtensionAttribute.cs
- SqlDependencyListener.cs
- HMACMD5.cs
- XamlReaderHelper.cs
- ContractAdapter.cs
- ObjectNavigationPropertyMapping.cs
- HashHelper.cs
- DesignSurfaceManager.cs
- OutputCache.cs
- AnnotationObservableCollection.cs
- errorpatternmatcher.cs
- listviewsubitemcollectioneditor.cs
- ImageEditor.cs
- SimpleType.cs
- FtpCachePolicyElement.cs
- LicFileLicenseProvider.cs
- ImpersonationContext.cs
- CircleHotSpot.cs
- PolicyLevel.cs
- Substitution.cs
- securestring.cs
- HtmlTableCell.cs
- DocumentViewerConstants.cs
- InstallerTypeAttribute.cs
- WebPartManager.cs
- ProxyGenerationError.cs
- MouseBinding.cs
- VerifyHashRequest.cs
- FontEditor.cs
- SchemaAttDef.cs
- RepeatBehavior.cs