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
- CharacterMetricsDictionary.cs
- WmlTextViewAdapter.cs
- InstanceStoreQueryResult.cs
- StorageMappingItemCollection.cs
- PluralizationService.cs
- BitmapPalettes.cs
- SecurityIdentifierElementCollection.cs
- Int64AnimationUsingKeyFrames.cs
- ComplexTypeEmitter.cs
- Rectangle.cs
- SnapLine.cs
- XmlFormatExtensionPointAttribute.cs
- DtdParser.cs
- X509ThumbprintKeyIdentifierClause.cs
- ComNativeDescriptor.cs
- PersonalizationProviderCollection.cs
- ZipIOExtraFieldZip64Element.cs
- PropertyToken.cs
- UnauthorizedWebPart.cs
- BrowserCapabilitiesFactory.cs
- Helpers.cs
- ZipFileInfo.cs
- ExpressionEditorAttribute.cs
- GridItemProviderWrapper.cs
- ChildChangedEventArgs.cs
- Slider.cs
- EdmSchemaAttribute.cs
- DropDownList.cs
- FormViewInsertEventArgs.cs
- GraphicsPath.cs
- AttachedPropertiesService.cs
- ResourceReferenceExpressionConverter.cs
- SqlServer2KCompatibilityCheck.cs
- _ConnectOverlappedAsyncResult.cs
- AudioStateChangedEventArgs.cs
- CultureSpecificCharacterBufferRange.cs
- NumberEdit.cs
- FocusManager.cs
- XmlQualifiedName.cs
- PrinterResolution.cs
- DataContractSet.cs
- EastAsianLunisolarCalendar.cs
- PersonalizableTypeEntry.cs
- TableCell.cs
- DiscoveryMessageProperty.cs
- HtmlTernaryTree.cs
- DataGridHeaderBorder.cs
- EntityWrapper.cs
- COSERVERINFO.cs
- SystemColors.cs
- ServiceContractAttribute.cs
- ControlBindingsCollection.cs
- CategoryAttribute.cs
- WorkflowServiceNamespace.cs
- Wildcard.cs
- NamespaceEmitter.cs
- Tuple.cs
- JsonWriter.cs
- GeometryDrawing.cs
- _KerberosClient.cs
- MouseActionValueSerializer.cs
- XmlSchemaInfo.cs
- _OverlappedAsyncResult.cs
- CryptoConfig.cs
- XmlChildEnumerator.cs
- SspiHelper.cs
- PipelineModuleStepContainer.cs
- FixedSOMTableCell.cs
- TypedTableGenerator.cs
- SystemInfo.cs
- RoutingBehavior.cs
- XmlSchemaNotation.cs
- SpellerError.cs
- PrivilegeNotHeldException.cs
- CodePrimitiveExpression.cs
- PagedDataSource.cs
- ThicknessKeyFrameCollection.cs
- Inflater.cs
- ManagementDateTime.cs
- KeyValueInternalCollection.cs
- IPHostEntry.cs
- GeneralTransform3DCollection.cs
- InternalDispatchObject.cs
- FixedHyperLink.cs
- MruCache.cs
- StartUpEventArgs.cs
- UIntPtr.cs
- TaskScheduler.cs
- Frame.cs
- IListConverters.cs
- AccessDataSource.cs
- SqlInternalConnectionSmi.cs
- SettingsAttributeDictionary.cs
- CompositeScriptReferenceEventArgs.cs
- Tool.cs
- ScrollBarAutomationPeer.cs
- ObjectSpanRewriter.cs
- DocumentSequenceHighlightLayer.cs
- ImageField.cs
- HtmlForm.cs