Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / ManagedLibraries / Remoting / Channels / TCP / TcpChannelHelper.cs / 1305376 / TcpChannelHelper.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //========================================================================== // File: TcpChannelHelper.cs // // Summary: Implements helper methods for tcp client and server channels. // //========================================================================= using System; using System.Text; using System.Runtime.Remoting.Channels; namespace System.Runtime.Remoting.Channels.Tcp { internal static class TcpChannelHelper { private const String _tcp = "tcp://"; // Used by tcp channels to implement IChannel::Parse. // It returns the channel uri and places object uri into out parameter. internal static String ParseURL(String url, out String objectURI) { // Set the out parameters objectURI = null; int separator; // Find the starting point of tcp:// // NOTE: We are using this version of String.Compare to ensure // that string operations are case-insensitive!! if (StringHelper.StartsWithAsciiIgnoreCasePrefixLower(url, _tcp)) { separator = _tcp.Length; } else { return null; } // find next slash (after end of scheme) separator = url.IndexOf('/', separator); if (-1 == separator) { return url; // means that the url is just "tcp://foo:90" or something like that } // Extract the channel URI which is the prefix String channelURI = url.Substring(0, separator); // Extract the object URI which is the suffix objectURI = url.Substring(separator); // leave the slash return channelURI; } // ParseURL } // class TcpChannelHelper } // namespace System.Runtime.Remoting.Channels.Tcp // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //========================================================================== // File: TcpChannelHelper.cs // // Summary: Implements helper methods for tcp client and server channels. // //========================================================================= using System; using System.Text; using System.Runtime.Remoting.Channels; namespace System.Runtime.Remoting.Channels.Tcp { internal static class TcpChannelHelper { private const String _tcp = "tcp://"; // Used by tcp channels to implement IChannel::Parse. // It returns the channel uri and places object uri into out parameter. internal static String ParseURL(String url, out String objectURI) { // Set the out parameters objectURI = null; int separator; // Find the starting point of tcp:// // NOTE: We are using this version of String.Compare to ensure // that string operations are case-insensitive!! if (StringHelper.StartsWithAsciiIgnoreCasePrefixLower(url, _tcp)) { separator = _tcp.Length; } else { return null; } // find next slash (after end of scheme) separator = url.IndexOf('/', separator); if (-1 == separator) { return url; // means that the url is just "tcp://foo:90" or something like that } // Extract the channel URI which is the prefix String channelURI = url.Substring(0, separator); // Extract the object URI which is the suffix objectURI = url.Substring(separator); // leave the slash return channelURI; } // ParseURL } // class TcpChannelHelper } // namespace System.Runtime.Remoting.Channels.Tcp // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IISUnsafeMethods.cs
- ServicePointManagerElement.cs
- ClusterRegistryConfigurationProvider.cs
- LineServicesRun.cs
- ContentDisposition.cs
- DetailsViewPagerRow.cs
- RSAPKCS1SignatureDeformatter.cs
- UInt16.cs
- CompileLiteralTextParser.cs
- ReflectionTypeLoadException.cs
- MetadataItemSerializer.cs
- ExtensionQuery.cs
- COM2ExtendedUITypeEditor.cs
- ClientUtils.cs
- DataRowView.cs
- BooleanConverter.cs
- ModelPerspective.cs
- BinaryMethodMessage.cs
- latinshape.cs
- GridViewAutomationPeer.cs
- ExceptionCollection.cs
- RegionData.cs
- BamlLocalizabilityResolver.cs
- RangeValuePattern.cs
- DbConnectionPoolGroupProviderInfo.cs
- Utils.cs
- FrugalMap.cs
- PackageStore.cs
- Int64Storage.cs
- CodeGroup.cs
- ThemeDictionaryExtension.cs
- CompilationRelaxations.cs
- COM2EnumConverter.cs
- MergablePropertyAttribute.cs
- ElementMarkupObject.cs
- Frame.cs
- RemotingClientProxy.cs
- EditorPartCollection.cs
- ErrorHandler.cs
- RightsManagementEncryptedStream.cs
- PtsHelper.cs
- shaperfactoryquerycacheentry.cs
- PageThemeBuildProvider.cs
- DictationGrammar.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- ListViewUpdateEventArgs.cs
- MemberAssignment.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- GatewayDefinition.cs
- ListChunk.cs
- DataGridViewMethods.cs
- XmlSchemaImport.cs
- SetStateDesigner.cs
- SqlCacheDependencyDatabaseCollection.cs
- AccessorTable.cs
- MemberAccessException.cs
- HtmlTextArea.cs
- AtomServiceDocumentSerializer.cs
- RuntimeTrackingProfile.cs
- MulticastIPAddressInformationCollection.cs
- autovalidator.cs
- RegexParser.cs
- BamlWriter.cs
- Errors.cs
- TextTreeTextElementNode.cs
- DeflateEmulationStream.cs
- InfiniteTimeSpanConverter.cs
- EventPrivateKey.cs
- Point3DCollectionConverter.cs
- Label.cs
- WebDescriptionAttribute.cs
- SymLanguageType.cs
- WorkflowStateRollbackService.cs
- StylusEditingBehavior.cs
- Atom10FeedFormatter.cs
- ImageSourceConverter.cs
- OrderByExpression.cs
- GenericQueueSurrogate.cs
- KeyGestureConverter.cs
- ISAPIApplicationHost.cs
- WebPermission.cs
- GridViewRowPresenter.cs
- Processor.cs
- TextParagraphView.cs
- _NestedMultipleAsyncResult.cs
- SvcMapFile.cs
- OdbcRowUpdatingEvent.cs
- WebUtil.cs
- X509SecurityTokenAuthenticator.cs
- AnnotationComponentManager.cs
- EllipseGeometry.cs
- BrowserTree.cs
- MetaDataInfo.cs
- PackWebRequestFactory.cs
- DataGridViewRowStateChangedEventArgs.cs
- CallbackValidatorAttribute.cs
- StringUtil.cs
- NavigationPropertySingletonExpression.cs
- ListViewGroupItemCollection.cs
- DataGridViewDesigner.cs