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
- FloatMinMaxAggregationOperator.cs
- altserialization.cs
- Point.cs
- SplineQuaternionKeyFrame.cs
- AsyncPostBackErrorEventArgs.cs
- NameService.cs
- ParserStack.cs
- GregorianCalendarHelper.cs
- SubclassTypeValidatorAttribute.cs
- ComplexTypeEmitter.cs
- ExternalDataExchangeService.cs
- UniqueIdentifierService.cs
- PointAnimationBase.cs
- InputLanguageProfileNotifySink.cs
- SerializationException.cs
- AttributeAction.cs
- FontStyle.cs
- ColorComboBox.cs
- __Filters.cs
- DesignRelation.cs
- StaticContext.cs
- AnimationLayer.cs
- QuaternionValueSerializer.cs
- ColorAnimation.cs
- ToolStripPanelRow.cs
- WsdlImporterElementCollection.cs
- DataGridCell.cs
- QueryOperationResponseOfT.cs
- FileUtil.cs
- SqlTriggerContext.cs
- UrlAuthFailedErrorFormatter.cs
- ViewCellSlot.cs
- BindableAttribute.cs
- RequestQueue.cs
- FixedSOMGroup.cs
- RbTree.cs
- XPathNodeIterator.cs
- SqlNodeAnnotations.cs
- ObjectSecurity.cs
- ZoneIdentityPermission.cs
- ExpressionBuilderCollection.cs
- Control.cs
- SafeProcessHandle.cs
- RenamedEventArgs.cs
- BooleanStorage.cs
- UniqueConstraint.cs
- ValueTypeIndexerReference.cs
- CultureInfoConverter.cs
- SafeEventLogReadHandle.cs
- ExtensionDataObject.cs
- QuaternionConverter.cs
- MimeTypePropertyAttribute.cs
- ApplicationSecurityInfo.cs
- ManagementBaseObject.cs
- DataGrid.cs
- XmlArrayItemAttributes.cs
- ZipIOExtraFieldPaddingElement.cs
- ConfigurationStrings.cs
- SecurityTokenValidationException.cs
- TextBoxView.cs
- HttpValueCollection.cs
- SchemaRegistration.cs
- BufferedStream.cs
- ContentPresenter.cs
- TraceFilter.cs
- SectionXmlInfo.cs
- __ComObject.cs
- PackagePart.cs
- CompositeControl.cs
- FocusManager.cs
- UriTemplateLiteralPathSegment.cs
- DelegatingStream.cs
- RealProxy.cs
- CollectionsUtil.cs
- EntitySqlQueryBuilder.cs
- Content.cs
- Visitors.cs
- CollectionViewSource.cs
- TriState.cs
- DSASignatureDeformatter.cs
- PagesSection.cs
- NTAccount.cs
- ManagementNamedValueCollection.cs
- DataTableReader.cs
- ProcessProtocolHandler.cs
- NativeMethods.cs
- AssertUtility.cs
- Helpers.cs
- ChannelFactoryRefCache.cs
- HtmlInputText.cs
- Bold.cs
- BitmapCacheBrush.cs
- WhitespaceReader.cs
- MarginCollapsingState.cs
- HashSetEqualityComparer.cs
- Util.cs
- printdlgexmarshaler.cs
- ExceptionUtil.cs
- ContainerUtilities.cs
- DataGridSortCommandEventArgs.cs