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
- TextServicesDisplayAttribute.cs
- BinaryParser.cs
- EntityDataSourceReferenceGroup.cs
- RequestTimeoutManager.cs
- EmptyElement.cs
- PropertyInformation.cs
- MaterialGroup.cs
- ReadWriteSpinLock.cs
- DataGridViewHeaderCell.cs
- Rect3D.cs
- DragEvent.cs
- DispatcherOperation.cs
- SQLInt32.cs
- OrderedDictionary.cs
- FontConverter.cs
- RectangleConverter.cs
- ClonableStack.cs
- DateTimeUtil.cs
- XmlResolver.cs
- PageParser.cs
- Error.cs
- recordstatefactory.cs
- parserscommon.cs
- UrlPropertyAttribute.cs
- _DomainName.cs
- PartialCachingControl.cs
- HostProtectionPermission.cs
- COM2IPerPropertyBrowsingHandler.cs
- LinkGrep.cs
- PolyLineSegment.cs
- RegexReplacement.cs
- WebPartConnectionsCancelVerb.cs
- XmlNavigatorFilter.cs
- HttpRequest.cs
- UndoManager.cs
- PreProcessInputEventArgs.cs
- IdnElement.cs
- ArrangedElement.cs
- JavaScriptString.cs
- EncryptedPackage.cs
- GlyphInfoList.cs
- SQlBooleanStorage.cs
- COM2Enum.cs
- AnnotationService.cs
- EditorZone.cs
- ReadWriteSpinLock.cs
- Rule.cs
- TemplateColumn.cs
- TemplatedWizardStep.cs
- Sequence.cs
- RootNamespaceAttribute.cs
- WebPartZoneCollection.cs
- SHA256Managed.cs
- RoutedEventValueSerializer.cs
- MenuRendererStandards.cs
- OracleConnectionStringBuilder.cs
- ErrorHandler.cs
- PlainXmlSerializer.cs
- IItemContainerGenerator.cs
- SqlGatherConsumedAliases.cs
- XPathScanner.cs
- HitTestDrawingContextWalker.cs
- HostingPreferredMapPath.cs
- InternalCache.cs
- DetailsViewInsertEventArgs.cs
- CharUnicodeInfo.cs
- AccessorTable.cs
- ValueTypeFixupInfo.cs
- TextRangeSerialization.cs
- SurrogateDataContract.cs
- TimeStampChecker.cs
- Crc32Helper.cs
- HttpRuntime.cs
- BufferCache.cs
- BasicExpandProvider.cs
- HttpCachePolicy.cs
- CheckBoxPopupAdapter.cs
- HTMLTagNameToTypeMapper.cs
- BamlRecordHelper.cs
- FrameworkElement.cs
- SqlCacheDependency.cs
- ResourceContainerWrapper.cs
- ACE.cs
- UnsafeNativeMethods.cs
- ProxyGenerationError.cs
- Pipe.cs
- MULTI_QI.cs
- Int32CAMarshaler.cs
- ValidationPropertyAttribute.cs
- SQLInt16Storage.cs
- SafeNativeMethods.cs
- TextTreePropertyUndoUnit.cs
- SqlDependencyUtils.cs
- DetailsViewInsertedEventArgs.cs
- CustomErrorsSection.cs
- DoubleKeyFrameCollection.cs
- CustomCategoryAttribute.cs
- PreProcessor.cs
- PocoEntityKeyStrategy.cs
- PostBackOptions.cs