Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Net / System / Net / NetworkInformation / PingOptions.cs / 1 / PingOptions.cs
//determines which options will be used for sending icmp requests, as well as what options
//were set in the returned icmp reply.
namespace System.Net.NetworkInformation
{
// Represent the possible ip options used for the icmp packet
public class PingOptions
{
const int DontFragmentFlag = 2;
int ttl = 128;
bool dontFragment;
internal PingOptions (IPOptions options) {
this.ttl = options.ttl;
this.dontFragment = ((options.flags & DontFragmentFlag) > 0 ? true : false);
}
public PingOptions (int ttl, bool dontFragment) {
if (ttl <= 0) {
throw new ArgumentOutOfRangeException("ttl");
}
this.ttl = ttl;
this.dontFragment = dontFragment;
}
public PingOptions () {
}
public int Ttl {
get {
return ttl;
}
set {
if (value <= 0) {
throw new ArgumentOutOfRangeException("value");
}
ttl = value; //useful to discover routes
}
}
public bool DontFragment {
get {
return dontFragment;
}
set {
dontFragment = value; //useful for discovering mtu
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//determines which options will be used for sending icmp requests, as well as what options
//were set in the returned icmp reply.
namespace System.Net.NetworkInformation
{
// Represent the possible ip options used for the icmp packet
public class PingOptions
{
const int DontFragmentFlag = 2;
int ttl = 128;
bool dontFragment;
internal PingOptions (IPOptions options) {
this.ttl = options.ttl;
this.dontFragment = ((options.flags & DontFragmentFlag) > 0 ? true : false);
}
public PingOptions (int ttl, bool dontFragment) {
if (ttl <= 0) {
throw new ArgumentOutOfRangeException("ttl");
}
this.ttl = ttl;
this.dontFragment = dontFragment;
}
public PingOptions () {
}
public int Ttl {
get {
return ttl;
}
set {
if (value <= 0) {
throw new ArgumentOutOfRangeException("value");
}
ttl = value; //useful to discover routes
}
}
public bool DontFragment {
get {
return dontFragment;
}
set {
dontFragment = value; //useful for discovering mtu
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EventLogPermissionEntry.cs
- FileAuthorizationModule.cs
- DbMetaDataCollectionNames.cs
- EndpointDiscoveryMetadata11.cs
- FormClosingEvent.cs
- EndpointDispatcherTable.cs
- TreeNodeBindingCollection.cs
- Int32Animation.cs
- SqlDataSourceFilteringEventArgs.cs
- _AutoWebProxyScriptEngine.cs
- InfoCardKeyedHashAlgorithm.cs
- String.cs
- ScriptingProfileServiceSection.cs
- SQLBytesStorage.cs
- Menu.cs
- BackStopAuthenticationModule.cs
- TextTreeFixupNode.cs
- AtomPub10CategoriesDocumentFormatter.cs
- _SingleItemRequestCache.cs
- UnicodeEncoding.cs
- NavigationWindow.cs
- Queue.cs
- DataKey.cs
- AuthenticationService.cs
- X509CertificateClaimSet.cs
- Errors.cs
- FolderBrowserDialog.cs
- DynamicScriptObject.cs
- Expression.cs
- ObjectMemberMapping.cs
- FaultFormatter.cs
- ForceCopyBuildProvider.cs
- WeakReferenceList.cs
- TextView.cs
- NaturalLanguageHyphenator.cs
- PageHandlerFactory.cs
- SparseMemoryStream.cs
- Codec.cs
- ForEachAction.cs
- SmtpMail.cs
- NamespaceQuery.cs
- TransactedBatchingElement.cs
- SoapObjectReader.cs
- Logging.cs
- CompressEmulationStream.cs
- HuffmanTree.cs
- OleDbParameter.cs
- LinkTarget.cs
- controlskin.cs
- EventProviderTraceListener.cs
- Bold.cs
- ControlPaint.cs
- SecurityUtils.cs
- AsyncContentLoadedEventArgs.cs
- AdRotator.cs
- BamlTreeUpdater.cs
- ResourcePool.cs
- MarshalByValueComponent.cs
- FontFamilyValueSerializer.cs
- TextLine.cs
- DocumentationServerProtocol.cs
- PropertyPathConverter.cs
- PropertyGrid.cs
- DataGridTextBoxColumn.cs
- QueryCacheKey.cs
- NetCodeGroup.cs
- TypeSystemProvider.cs
- DupHandleConnectionReader.cs
- InheritanceRules.cs
- AsyncResult.cs
- Translator.cs
- CommandManager.cs
- HandlerBase.cs
- ProxyElement.cs
- isolationinterop.cs
- GradientStopCollection.cs
- PartialList.cs
- HtmlInputRadioButton.cs
- InfoCardAsymmetricCrypto.cs
- SiteMapSection.cs
- AllMembershipCondition.cs
- Stroke2.cs
- Sql8ExpressionRewriter.cs
- SafeNativeMethods.cs
- SendKeys.cs
- ConfigXmlElement.cs
- ContextMenuStripGroupCollection.cs
- AppendHelper.cs
- InternalDispatchObject.cs
- FontSource.cs
- SupportsEventValidationAttribute.cs
- ProxyManager.cs
- DataGridViewSelectedCellCollection.cs
- NameValueConfigurationCollection.cs
- CodeObject.cs
- AppSecurityManager.cs
- SqlStream.cs
- WebBrowserNavigatingEventHandler.cs
- QilBinary.cs
- CodeAttachEventStatement.cs