Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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
}
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ObjectDataSourceSelectingEventArgs.cs
- SecurityTokenProvider.cs
- EditingCommands.cs
- UndoEngine.cs
- RequiredAttributeAttribute.cs
- XmlAttributeAttribute.cs
- BamlResourceSerializer.cs
- UserMapPath.cs
- ScriptComponentDescriptor.cs
- MultiTrigger.cs
- WebControlsSection.cs
- DesignerValidatorAdapter.cs
- HtmlElementErrorEventArgs.cs
- ValueChangedEventManager.cs
- StreamingContext.cs
- LeaseManager.cs
- AssemblyBuilder.cs
- TreePrinter.cs
- XPathNodeIterator.cs
- CrossSiteScriptingValidation.cs
- LocalBuilder.cs
- ToolStripSplitButton.cs
- Opcode.cs
- ThousandthOfEmRealDoubles.cs
- dbenumerator.cs
- ToolStripHighContrastRenderer.cs
- ExpressionBuilder.cs
- PersistenceContext.cs
- MultiPropertyDescriptorGridEntry.cs
- ProviderConnectionPoint.cs
- SamlSecurityToken.cs
- SrgsGrammarCompiler.cs
- TagMapInfo.cs
- OleDbCommand.cs
- BridgeDataRecord.cs
- UpdateTracker.cs
- OdbcError.cs
- ComponentDispatcher.cs
- CqlGenerator.cs
- SQLMembershipProvider.cs
- NavigationPropertyAccessor.cs
- Rules.cs
- PartManifestEntry.cs
- PreProcessor.cs
- StylusShape.cs
- Wrapper.cs
- AlphabetConverter.cs
- X509Chain.cs
- StreamInfo.cs
- QilBinary.cs
- DataTemplate.cs
- TargetInvocationException.cs
- _Events.cs
- PointAnimation.cs
- URLIdentityPermission.cs
- ArgumentNullException.cs
- QilTargetType.cs
- Win32SafeHandles.cs
- ContextStack.cs
- X509Extension.cs
- AbstractExpressions.cs
- WebPartVerbCollection.cs
- DropShadowEffect.cs
- DependencyPropertyValueSerializer.cs
- SpellerInterop.cs
- CustomLineCap.cs
- SQLString.cs
- DragDeltaEventArgs.cs
- DataColumn.cs
- EngineSiteSapi.cs
- SocketInformation.cs
- _ListenerAsyncResult.cs
- BaseDataListComponentEditor.cs
- DataListItem.cs
- SQLSingle.cs
- TTSEngineTypes.cs
- ConfigPathUtility.cs
- BulletDecorator.cs
- ContentTypeSettingDispatchMessageFormatter.cs
- Profiler.cs
- Identifier.cs
- LinqDataSourceValidationException.cs
- SendMailErrorEventArgs.cs
- AnimationClockResource.cs
- ImageKeyConverter.cs
- XsdDateTime.cs
- SoapMessage.cs
- TreeView.cs
- TypeTypeConverter.cs
- MeshGeometry3D.cs
- ByteStreamGeometryContext.cs
- SortExpressionBuilder.cs
- MethodBuilderInstantiation.cs
- RtfFormatStack.cs
- Expander.cs
- BoundField.cs
- EntityDataSourceState.cs
- WebPartZone.cs
- QilInvokeLateBound.cs
- SamlAssertion.cs