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
- HttpCapabilitiesSectionHandler.cs
- StorageComplexTypeMapping.cs
- FormView.cs
- XmlSchemaObject.cs
- PageAdapter.cs
- SerializationObjectManager.cs
- DesignParameter.cs
- TransformCollection.cs
- TableProviderWrapper.cs
- TextEditorSpelling.cs
- TdsParserStateObject.cs
- LambdaCompiler.Logical.cs
- AppDomainAttributes.cs
- RuleSettings.cs
- ProfessionalColors.cs
- EventEntry.cs
- QueryOperationResponseOfT.cs
- CustomErrorsSectionWrapper.cs
- SystemIPv6InterfaceProperties.cs
- DataGridViewCellEventArgs.cs
- ErrorFormatter.cs
- SqlDataSourceWizardForm.cs
- Bold.cs
- XmlSchemaSimpleContentExtension.cs
- LocalizableAttribute.cs
- TreeNodeBinding.cs
- DrawingContextWalker.cs
- StylusButtonCollection.cs
- PageAsyncTaskManager.cs
- PenContexts.cs
- MethodCallConverter.cs
- TextTreeObjectNode.cs
- StylusDownEventArgs.cs
- LinearQuaternionKeyFrame.cs
- XPathArrayIterator.cs
- LayoutTable.cs
- TextRangeProviderWrapper.cs
- OuterGlowBitmapEffect.cs
- SchemaCollectionPreprocessor.cs
- CompiledQueryCacheKey.cs
- PropertyEmitterBase.cs
- InstanceNameConverter.cs
- RectAnimationUsingKeyFrames.cs
- NumberFormatInfo.cs
- ToolStripItem.cs
- ModelService.cs
- TableAdapterManagerMethodGenerator.cs
- Preprocessor.cs
- EntityClientCacheEntry.cs
- CommandField.cs
- Freezable.cs
- RegexGroupCollection.cs
- PropertyGridView.cs
- ClientProxyGenerator.cs
- EncryptedKeyHashIdentifierClause.cs
- IApplicationTrustManager.cs
- XmlSchemaDatatype.cs
- CodeCastExpression.cs
- DefaultValueConverter.cs
- Stroke.cs
- SafeTokenHandle.cs
- SimpleHandlerBuildProvider.cs
- VirtualizedItemPattern.cs
- ImageMapEventArgs.cs
- PartBasedPackageProperties.cs
- XmlSiteMapProvider.cs
- IconBitmapDecoder.cs
- FigureParaClient.cs
- HttpApplicationFactory.cs
- XmlBufferReader.cs
- Message.cs
- SpAudioStreamWrapper.cs
- TextSpan.cs
- WebPartZoneCollection.cs
- AlternateViewCollection.cs
- ExecutionEngineException.cs
- TypeForwardedToAttribute.cs
- CodeGeneratorOptions.cs
- RSAPKCS1SignatureDeformatter.cs
- DocumentsTrace.cs
- InvokeHandlers.cs
- StringDictionary.cs
- DigitShape.cs
- BitmapEffectOutputConnector.cs
- __Filters.cs
- CodeRemoveEventStatement.cs
- Permission.cs
- ChainedAsyncResult.cs
- HttpHandlerActionCollection.cs
- BindingOperations.cs
- HttpCachePolicyWrapper.cs
- Delegate.cs
- SmtpNetworkElement.cs
- WindowsAltTab.cs
- MethodRental.cs
- StylusPointProperty.cs
- ApplyHostConfigurationBehavior.cs
- UnknownBitmapEncoder.cs
- ConfigXmlComment.cs
- ColorDialog.cs