Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / ManagedLibraries / Remoting / Channels / IPC / IpcChannelHelper.cs / 1305376 / IpcChannelHelper.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //========================================================================== // File: IpcChannelHelper.cs // Author: [....]@Microsoft.Com // Summary: Implements helper methods for Ipc client and server channels. // //========================================================================= using System; using System.IO; using System.Collections; using System.Runtime.Remoting.Channels; namespace System.Runtime.Remoting.Channels.Ipc { internal static class IpcChannelHelper { private const String _ipc = "ipc://"; // see if the string starts with "ipc://" internal static bool StartsWithIpc(String url) { return StringHelper.StartsWithAsciiIgnoreCasePrefixLower(url, _ipc); } // StartsWithIpc // Used by Ipc 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) { if (url == null) throw new ArgumentNullException("url"); // Set the out parameters objectURI = null; int separator; // Find the starting point of ipc:// // NOTE: We are using this version of String.Compare to ensure // that string operations are case-insensitive!! if (StartsWithIpc(url)) { separator = _ipc.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 "Ipc://foo" 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 IpcChannelHelper } // namespace System.Runtime.Remoting.Channels.Ipc // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //========================================================================== // File: IpcChannelHelper.cs // Author: [....]@Microsoft.Com // Summary: Implements helper methods for Ipc client and server channels. // //========================================================================= using System; using System.IO; using System.Collections; using System.Runtime.Remoting.Channels; namespace System.Runtime.Remoting.Channels.Ipc { internal static class IpcChannelHelper { private const String _ipc = "ipc://"; // see if the string starts with "ipc://" internal static bool StartsWithIpc(String url) { return StringHelper.StartsWithAsciiIgnoreCasePrefixLower(url, _ipc); } // StartsWithIpc // Used by Ipc 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) { if (url == null) throw new ArgumentNullException("url"); // Set the out parameters objectURI = null; int separator; // Find the starting point of ipc:// // NOTE: We are using this version of String.Compare to ensure // that string operations are case-insensitive!! if (StartsWithIpc(url)) { separator = _ipc.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 "Ipc://foo" 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 IpcChannelHelper } // namespace System.Runtime.Remoting.Channels.Ipc // 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
- GAC.cs
- UpdateExpressionVisitor.cs
- VisualTreeHelper.cs
- Label.cs
- HttpWebRequest.cs
- ReachDocumentPageSerializer.cs
- Model3DCollection.cs
- MailMessageEventArgs.cs
- SqlMethodCallConverter.cs
- DBSqlParserTableCollection.cs
- FrameworkContentElement.cs
- Rule.cs
- ManualResetEvent.cs
- LineGeometry.cs
- OLEDB_Enum.cs
- OdbcConnectionPoolProviderInfo.cs
- EdmError.cs
- DropDownList.cs
- HostedImpersonationContext.cs
- DSACryptoServiceProvider.cs
- TimeSpanStorage.cs
- documentsequencetextpointer.cs
- NGCSerializer.cs
- ExpressionNode.cs
- RangeValuePatternIdentifiers.cs
- DecimalAnimation.cs
- IgnoreFlushAndCloseStream.cs
- TextSelectionHighlightLayer.cs
- QuaternionConverter.cs
- AutomationAttributeInfo.cs
- ScriptControl.cs
- InitializerFacet.cs
- DateTimeFormatInfoScanner.cs
- QueryContinueDragEvent.cs
- AnnotationDocumentPaginator.cs
- _ConnectOverlappedAsyncResult.cs
- TraceContext.cs
- NonNullItemCollection.cs
- Parameter.cs
- DataBindingCollection.cs
- IntSecurity.cs
- SQLDecimal.cs
- Stroke.cs
- PropertyGeneratedEventArgs.cs
- StrongNameKeyPair.cs
- InvalidContentTypeException.cs
- InfoCardClaimCollection.cs
- ConnectionsZoneAutoFormat.cs
- DictationGrammar.cs
- ComponentResourceManager.cs
- Table.cs
- EventlogProvider.cs
- UdpContractFilterBehavior.cs
- Int16AnimationBase.cs
- LocatorManager.cs
- LookupNode.cs
- COM2PictureConverter.cs
- ViewgenGatekeeper.cs
- LocalizableResourceBuilder.cs
- CallTemplateAction.cs
- TypeResolvingOptionsAttribute.cs
- DbParameterHelper.cs
- CompoundFileStreamReference.cs
- XmlComplianceUtil.cs
- DescendantQuery.cs
- IntegrationExceptionEventArgs.cs
- WarningException.cs
- DataGridViewLinkCell.cs
- CalendarData.cs
- TreeChangeInfo.cs
- LookupNode.cs
- tabpagecollectioneditor.cs
- Parsers.cs
- DBBindings.cs
- BuilderPropertyEntry.cs
- DrawListViewItemEventArgs.cs
- BuildProvider.cs
- ErrorItem.cs
- AQNBuilder.cs
- NamespaceInfo.cs
- CompositeFontParser.cs
- FixedSOMPageElement.cs
- TextRange.cs
- SqlClientWrapperSmiStreamChars.cs
- RemoteCryptoRsaServiceProvider.cs
- DataGridHelper.cs
- RegexGroupCollection.cs
- TypeResolver.cs
- ipaddressinformationcollection.cs
- PasswordPropertyTextAttribute.cs
- MailMessageEventArgs.cs
- OpenFileDialog.cs
- MimeTextImporter.cs
- WorkflowMessageEventArgs.cs
- DataAdapter.cs
- CodeAttributeDeclaration.cs
- TrustManagerPromptUI.cs
- ProtocolInformationReader.cs
- EditorZoneBase.cs
- IgnoreFlushAndCloseStream.cs