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
- Vector3DKeyFrameCollection.cs
- ViewStateModeByIdAttribute.cs
- FormParameter.cs
- NeutralResourcesLanguageAttribute.cs
- Overlapped.cs
- DataGridViewBindingCompleteEventArgs.cs
- TCEAdapterGenerator.cs
- FileDataSourceCache.cs
- Exceptions.cs
- UserControl.cs
- EntityConnection.cs
- SoapMessage.cs
- RNGCryptoServiceProvider.cs
- XmlUtf8RawTextWriter.cs
- DataBoundControlAdapter.cs
- GenericRootAutomationPeer.cs
- SingleAnimation.cs
- BitmapImage.cs
- XPathSelectionIterator.cs
- FontFamily.cs
- RequestCache.cs
- CapabilitiesRule.cs
- AsymmetricKeyExchangeDeformatter.cs
- Graph.cs
- WebAdminConfigurationHelper.cs
- SelectionList.cs
- SHA512.cs
- RowsCopiedEventArgs.cs
- BindingMemberInfo.cs
- TypeBrowser.xaml.cs
- FormsAuthenticationCredentials.cs
- Axis.cs
- Selection.cs
- WindowsIdentity.cs
- TableItemPattern.cs
- SmtpReplyReader.cs
- GPRECTF.cs
- DataGridComboBoxColumn.cs
- Rect.cs
- SchemaMerger.cs
- FormatException.cs
- XmlBoundElement.cs
- SafeNativeMemoryHandle.cs
- DataBoundControl.cs
- MediaSystem.cs
- ThreadStateException.cs
- PenThreadPool.cs
- EntityParameter.cs
- OleDbDataReader.cs
- EntitySqlQueryCacheEntry.cs
- TextElement.cs
- AddInActivator.cs
- Vector3DCollectionValueSerializer.cs
- GeometryHitTestParameters.cs
- CodeExpressionStatement.cs
- FormsAuthenticationCredentials.cs
- RegexRunner.cs
- ConfigurationValidatorAttribute.cs
- unsafenativemethodstextservices.cs
- KoreanLunisolarCalendar.cs
- DefaultValueConverter.cs
- TableParaClient.cs
- SingleAnimationUsingKeyFrames.cs
- ProfileProvider.cs
- ToolBarButtonDesigner.cs
- NetNamedPipeBindingCollectionElement.cs
- XsltCompileContext.cs
- CommandValueSerializer.cs
- SqlDataSourceSelectingEventArgs.cs
- Baml2006Reader.cs
- ProvidePropertyAttribute.cs
- TypefaceMetricsCache.cs
- ZipPackage.cs
- ProcessManager.cs
- BooleanAnimationBase.cs
- AddInActivator.cs
- PagerSettings.cs
- XmlDataSourceNodeDescriptor.cs
- DataControlFieldCell.cs
- StorageBasedPackageProperties.cs
- MutexSecurity.cs
- SectionUpdates.cs
- WebScriptMetadataInstanceContextProvider.cs
- TemplateField.cs
- Decimal.cs
- TypeToken.cs
- CodeCatchClauseCollection.cs
- ImageListImageEditor.cs
- PolygonHotSpot.cs
- Stackframe.cs
- FormsAuthentication.cs
- AssemblySettingAttributes.cs
- HttpCacheParams.cs
- PenThreadPool.cs
- CombinedGeometry.cs
- RecordsAffectedEventArgs.cs
- XmlAttributeOverrides.cs
- WebProxyScriptElement.cs
- HttpCachePolicy.cs
- WinEventQueueItem.cs