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
- CodeNamespaceCollection.cs
- DbInsertCommandTree.cs
- Evaluator.cs
- UnmanagedHandle.cs
- DataGridDetailsPresenterAutomationPeer.cs
- ComponentDispatcherThread.cs
- AdornerLayer.cs
- XmlUtf8RawTextWriter.cs
- ToolbarAUtomationPeer.cs
- RootNamespaceAttribute.cs
- HostSecurityManager.cs
- BehaviorService.cs
- COM2ExtendedUITypeEditor.cs
- WebPartDescriptionCollection.cs
- EditCommandColumn.cs
- MouseDevice.cs
- TreeNodeBindingCollection.cs
- precedingquery.cs
- TableRowCollection.cs
- TextParagraphCache.cs
- TrackingValidationObjectDictionary.cs
- ACL.cs
- HTMLTagNameToTypeMapper.cs
- XmlStringTable.cs
- HeaderUtility.cs
- MasterPage.cs
- DataGridBeginningEditEventArgs.cs
- DataGridTable.cs
- DetailsViewCommandEventArgs.cs
- DomNameTable.cs
- Stack.cs
- TextWriter.cs
- DataTableReaderListener.cs
- ResourceIDHelper.cs
- CodeDirectiveCollection.cs
- Formatter.cs
- BaseValidator.cs
- HMACSHA512.cs
- ExpandCollapsePattern.cs
- DependencyPropertyHelper.cs
- mil_commands.cs
- PageParserFilter.cs
- TableHeaderCell.cs
- URI.cs
- RequestResizeEvent.cs
- RuleValidation.cs
- EnumConverter.cs
- Point.cs
- OletxResourceManager.cs
- SelectedGridItemChangedEvent.cs
- PolicyValidationException.cs
- EventHandlers.cs
- WebEventTraceProvider.cs
- PieceNameHelper.cs
- AssemblyInfo.cs
- DomainConstraint.cs
- XD.cs
- ConfigurationPropertyAttribute.cs
- SqlDataReader.cs
- XPathEmptyIterator.cs
- DateTimeStorage.cs
- FormatterServices.cs
- EpmAttributeNameBuilder.cs
- BitmapEffectInput.cs
- SecurityKeyUsage.cs
- TabItemAutomationPeer.cs
- UnknownExceptionActionHelper.cs
- XmlDesigner.cs
- SrgsElementList.cs
- GifBitmapDecoder.cs
- SelectionHighlightInfo.cs
- ArgumentElement.cs
- PerformanceCounterPermission.cs
- UInt16Converter.cs
- ComMethodElement.cs
- DelegateSerializationHolder.cs
- SurrogateEncoder.cs
- ConfigXmlComment.cs
- X509Certificate2.cs
- SolidColorBrush.cs
- XmlDataProvider.cs
- CollectionContainer.cs
- SystemInformation.cs
- KeyNameIdentifierClause.cs
- ParserOptions.cs
- SemanticTag.cs
- RtfToXamlLexer.cs
- ReferenceAssemblyAttribute.cs
- XmlDeclaration.cs
- ObjectIDGenerator.cs
- SerializationHelper.cs
- SamlAssertion.cs
- TableProviderWrapper.cs
- Identity.cs
- DefaultParameterValueAttribute.cs
- PrintPageEvent.cs
- UIElementHelper.cs
- SiteMapNodeItem.cs
- PropertyDescriptorComparer.cs
- Visual3D.cs