Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ContractAdapter.cs
- ValidationEventArgs.cs
- XmlBinaryWriterSession.cs
- MaskInputRejectedEventArgs.cs
- ColorContextHelper.cs
- PenLineJoinValidation.cs
- WebResponse.cs
- ImageBrush.cs
- DataGridAutoFormat.cs
- ActivityPreviewDesigner.cs
- PropertyManager.cs
- VarRemapper.cs
- TopClause.cs
- CommonRemoteMemoryBlock.cs
- DataTableExtensions.cs
- SamlAuthenticationClaimResource.cs
- CombinedHttpChannel.cs
- QueryContext.cs
- WeakEventTable.cs
- FontUnit.cs
- MessageQueuePermissionEntryCollection.cs
- SocketElement.cs
- WizardPanel.cs
- XsdBuilder.cs
- DataGridCellsPanel.cs
- MaskDescriptors.cs
- SmtpSection.cs
- TreeNodeCollection.cs
- CalendarDataBindingHandler.cs
- ZipIOFileItemStream.cs
- SignedInfo.cs
- SurrogateChar.cs
- EdmProviderManifest.cs
- WinInetCache.cs
- FrugalList.cs
- ThrowHelper.cs
- Gdiplus.cs
- InternalsVisibleToAttribute.cs
- LinqDataSourceContextEventArgs.cs
- PixelShader.cs
- _Events.cs
- RuntimeHandles.cs
- ToggleButton.cs
- PreDigestedSignedInfo.cs
- EnumerableValidator.cs
- ForAllOperator.cs
- SerialErrors.cs
- HuffModule.cs
- NamedPermissionSet.cs
- SettingsAttributes.cs
- ToolBar.cs
- XamlFigureLengthSerializer.cs
- WmlControlAdapter.cs
- HttpListenerResponse.cs
- InkCollectionBehavior.cs
- PointAnimationBase.cs
- ButtonField.cs
- XmlNotation.cs
- Tokenizer.cs
- Label.cs
- SerializableAttribute.cs
- HttpProfileGroupBase.cs
- SplayTreeNode.cs
- XPathScanner.cs
- AnimationLayer.cs
- DataRecordInternal.cs
- KeyProperty.cs
- InputMethodStateTypeInfo.cs
- GroupBox.cs
- PageHandlerFactory.cs
- ParserExtension.cs
- XmlDataProvider.cs
- TextDecorationLocationValidation.cs
- BuiltInExpr.cs
- FolderBrowserDialog.cs
- HitTestDrawingContextWalker.cs
- ScrollProviderWrapper.cs
- FixUpCollection.cs
- AttachInfo.cs
- XhtmlBasicCalendarAdapter.cs
- GridViewUpdatedEventArgs.cs
- SQLBinaryStorage.cs
- IdentifierElement.cs
- ClientScriptManager.cs
- BulletDecorator.cs
- WebHttpDispatchOperationSelector.cs
- DiscardableAttribute.cs
- CodeTypeParameter.cs
- DataGridViewCellPaintingEventArgs.cs
- CompilerCollection.cs
- DataGridViewElement.cs
- WebServiceTypeData.cs
- IgnoreDeviceFilterElement.cs
- DataRowCollection.cs
- CodeLabeledStatement.cs
- ButtonField.cs
- SiteMapNodeCollection.cs
- TrackingRecord.cs
- ElementFactory.cs
- HandleDictionary.cs