forked from dotnet/dotnet-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ping.xml
2121 lines (1895 loc) · 217 KB
/
Ping.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Type Name="Ping" FullName="System.Net.NetworkInformation.Ping">
<TypeSignature Language="C#" Value="public class Ping : System.ComponentModel.Component" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Ping extends System.ComponentModel.Component" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1" />
<TypeSignature Language="DocId" Value="T:System.Net.NetworkInformation.Ping" />
<TypeSignature Language="VB.NET" Value="Public Class Ping
Inherits Component" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1" />
<TypeSignature Language="C++ CLI" Value="public ref class Ping : System::ComponentModel::Component" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1" />
<TypeSignature Language="F#" Value="type Ping = class
 inherit Component" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1" />
<TypeSignature Language="C#" Value="public class Ping : IDisposable" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Ping extends System.Object implements class System.IDisposable" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<TypeSignature Language="VB.NET" Value="Public Class Ping
Implements IDisposable" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<TypeSignature Language="C++ CLI" Value="public ref class Ping : IDisposable" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<TypeSignature Language="F#" Value="type Ping = class
 interface IDisposable" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<TypeSignature Language="C#" Value="public class Ping : System.ComponentModel.Component, IDisposable" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Ping extends System.ComponentModel.Component implements class System.IDisposable" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;xamarinios-10.8" />
<TypeSignature Language="VB.NET" Value="Public Class Ping
Inherits Component
Implements IDisposable" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<TypeSignature Language="C++ CLI" Value="public ref class Ping : System::ComponentModel::Component, IDisposable" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<TypeSignature Language="F#" Value="type Ping = class
 inherit Component
 interface IDisposable" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi Ping extends System.ComponentModel.Component implements class System.IDisposable" FrameworkAlternate="xamarinandroid-7.1;xamarinmac-3.0" />
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Net.Ping" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.ComponentModel.Component</BaseTypeName>
<BaseTypeName FrameworkAlternate="netcore-1.0;netcore-1.1">System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface FrameworkAlternate="netcore-1.0;netcore-1.1;netframework-2.0;netframework-3.0;netframework-3.5;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName Language="C#">[System.MonoTODO("IPv6 support is missing")]</AttributeName>
<AttributeName Language="F#">[<System.MonoTODO("IPv6 support is missing")>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Allows an application to determine whether a remote computer is accessible over the network.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Applications use the <xref:System.Net.NetworkInformation.Ping> class to detect whether a remote computer is reachable.
Network topology can determine whether <xref:System.Net.NetworkInformation.Ping> can successfully contact a remote host. The presence and configuration of proxies, network address translation (NAT) equipment, or firewalls can prevent <xref:System.Net.NetworkInformation.Ping> from succeeding. A successful <xref:System.Net.NetworkInformation.Ping> indicates only that the remote host can be reached on the network; the presence of higher level services (such as a Web server) on the remote host is not guaranteed.
This class provides functionality similar to the Ping.exe command line tool. The <xref:System.Net.NetworkInformation.Ping.Send%2A> and <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> methods send an Internet Control Message Protocol (ICMP) echo request message to a remote computer and waits for an ICMP echo reply message from that computer. For a detailed description of ICMP messages, see RFC 792, available at [https://www.ietf.org](https://www.ietf.org/).
The default timeout when timeout is not specified is 5 seconds similar to Ping.exe command line tool timeout.
The following types are used with the <xref:System.Net.NetworkInformation.Ping> class and are described in detail below.
|**Type name**|**Description**|
|-------------------|---------------------|
|<xref:System.Net.NetworkInformation.IPStatus>|Defines status codes that describe the outcome of an ICMP echo request message.|
|<xref:System.Net.NetworkInformation.PingOptions>|Allows you to configure or retrieve the settings that control how many times the request packet can be forwarded (<xref:System.Net.NetworkInformation.PingOptions.Ttl%2A>), and whether it can be fragmented (<xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> ).|
|<xref:System.Net.NetworkInformation.PingReply>|Contains the results of an ICMP echo request.|
|<xref:System.Net.NetworkInformation.PingException>|Thrown if an unrecoverable error occurs.|
|<xref:System.Net.NetworkInformation.PingCompletedEventArgs>|Contains the data associated with <xref:System.Net.NetworkInformation.Ping.PingCompleted> events, which are raised when a <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> call completes or is canceled.|
|<xref:System.Net.NetworkInformation.PingCompletedEventHandler>|The delegate that provides the callback method invoked when a <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> call completes or is canceled.|
The <xref:System.Net.NetworkInformation.Ping.Send%2A> and <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> methods return the reply in a <xref:System.Net.NetworkInformation.PingReply> object. The <xref:System.Net.NetworkInformation.PingReply.Status%2A?displayProperty=nameWithType> property returns an <xref:System.Net.NetworkInformation.IPStatus> value to indicate the outcome of the request.
When sending the request, you must specify the remote computer. You can do this by providing a host name string, an IP address in string format, or an <xref:System.Net.IPAddress> object.
You can also specify any of the following types of information:
- Data to accompany the request. Specifying `buffer` allows you to learn the amount of time required for a packet of a particular size to travel to and from the remote host and the maximum transmission unit of the network path. (See the <xref:System.Net.NetworkInformation.Ping.Send%2A> or <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> overloads that take a `buffer` parameter.)
- Whether the ICMP Echo packet can be fragmented in transit. (See the <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> property and the <xref:System.Net.NetworkInformation.Ping.Send%2A> or <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> overloads that take an `options` parameter.)
- How many times routing nodes, such as routers or gateways, can forward the packet before it either reaches the destination computer or is discarded. (See <xref:System.Net.NetworkInformation.PingOptions.Ttl%2A> and the <xref:System.Net.NetworkInformation.Ping.Send%2A> or <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> overloads that take an `options` parameter.)
- The time limit within which the reply must be received. (See the <xref:System.Net.NetworkInformation.Ping.Send%2A> or <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> overloads that take a `timeout` parameter.
The <xref:System.Net.NetworkInformation.Ping> class offers both synchronous and asynchronous methods for sending the request. If your application should block while waiting for a reply, use the <xref:System.Net.NetworkInformation.Ping.Send%2A> methods; these methods are synchronous. If your application should not block, use the asynchronous <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> methods. A call to <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> executes in its own thread that is automatically allocated from the thread pool. When the asynchronous operation completes, it raises the <xref:System.Net.NetworkInformation.Ping.PingCompleted> event. Applications use a <xref:System.Net.NetworkInformation.PingCompletedEventHandler> delegate to specify the method that is called for <xref:System.Net.NetworkInformation.Ping.PingCompleted> events. You must add a <xref:System.Net.NetworkInformation.PingCompletedEventHandler> delegate to the event before calling <xref:System.Net.NetworkInformation.Ping.SendAsync%2A>. The delegate's method receives a <xref:System.Net.NetworkInformation.PingCompletedEventArgs> object that contains a <xref:System.Net.NetworkInformation.PingReply> object that describes the result of the <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> call.
You cannot use the same instance of the <xref:System.Net.NetworkInformation.Ping> class to generate multiple simultaneous ICMP Echo requests. Calling <xref:System.Net.NetworkInformation.Ping.Send%2A> while a <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> call is in progress or calling <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> multiple times before all previous calls have completed causes an <xref:System.InvalidOperationException>.
## Examples
The following code example demonstrates using the <xref:System.Net.NetworkInformation.Ping> class synchronously.
[!code-cpp[NCLPingSync#1](~/samples/snippets/cpp/VS_Snippets_Remoting/NclPingSync/CPP/syncping.cpp#1)]
[!code-csharp[NCLPingSync#1](~/samples/snippets/csharp/VS_Snippets_Remoting/NclPingSync/CS/syncping.cs#1)]
The following code example demonstrates using the <xref:System.Net.NetworkInformation.Ping> class asynchronously.
[!code-cpp[NCLPingASync#1](~/samples/snippets/cpp/VS_Snippets_Remoting/NclPingAsync/CPP/asyncping.cpp#1)]
[!code-csharp[NCLPingASync#1](~/samples/snippets/csharp/VS_Snippets_Remoting/NclPingAsync/CS/asyncping.cs#1)]
]]></format>
</remarks>
<related type="Article" href="/dotnet/framework/network-programming/how-to-ping-a-host">How to: Ping a Host</related>
<related type="Article" href="/dotnet/framework/network-programming/">Network Programming in the .NET Framework</related>
<related type="Article" href="/dotnet/framework/network-programming/network-programming-samples">Network Programming Samples</related>
<related type="Article" href="/dotnet/framework/network-programming/networkinformation">NetworkInformation</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Ping ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 Ping();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Net.NetworkInformation.Ping" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates creating a <xref:System.Net.NetworkInformation.Ping> instance. The complete example is available in the <xref:System.Net.NetworkInformation.Ping> class overview.
[!code-cpp[NCLPingAsync#2](~/samples/snippets/cpp/VS_Snippets_Remoting/NclPingAsync/CPP/asyncping.cpp#2)]
[!code-csharp[NCLPingAsync#2](~/samples/snippets/csharp/VS_Snippets_Remoting/NclPingAsync/CS/asyncping.cs#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="public void Dispose ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.Dispose" />
<MemberSignature Language="VB.NET" Value="Public Sub Dispose ()" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual void Dispose();" />
<MemberSignature Language="F#" Value="abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit" Usage="ping.Dispose " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IDisposable.Dispose</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases the unmanaged resources and disposes of the managed resources used by the <see cref="T:System.Net.NetworkInformation.Ping" />.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub Dispose (disposing As Boolean)" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1" />
<MemberSignature Language="C++ CLI" Value="protected:
 override void Dispose(bool disposing);" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1" />
<MemberSignature Language="F#" Value="override this.Dispose : bool -> unit" Usage="ping.Dispose disposing" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1" />
<MemberSignature Language="C#" Value="protected virtual void Dispose (bool disposing);" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void Dispose(bool disposing) cil managed" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub Dispose (disposing As Boolean)" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<MemberSignature Language="C++ CLI" Value="protected:
 virtual void Dispose(bool disposing);" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<MemberSignature Language="F#" Value="abstract member Dispose : bool -> unit
override this.Dispose : bool -> unit" Usage="ping.Dispose disposing" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" Index="0" FrameworkAlternate="net-5.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to releases only unmanaged resources.</param>
<summary>Releases the unmanaged resources used by the <see cref="T:System.Net.NetworkInformation.Ping" /> object, and optionally disposes of the managed resources.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is called by the public `Dispose()` method and the <xref:System.ComponentModel.Component.Finalize%2A> method. The public `Dispose()` method invokes the protected <xref:System.Net.NetworkInformation.Ping.Dispose%2A> method with the `disposing` parameter set to `true`. <xref:System.ComponentModel.Component.Finalize%2A> invokes `Dispose` with `disposing` set to `false`.
When the `disposing` parameter is `true`, this method releases all resources held by any managed objects that this <xref:System.Net.NetworkInformation.Ping> object references. This method invokes the `Dispose()` method of each referenced object.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="OnPingCompleted">
<MemberSignature Language="C#" Value="protected void OnPingCompleted (System.Net.NetworkInformation.PingCompletedEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance void OnPingCompleted(class System.Net.NetworkInformation.PingCompletedEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.OnPingCompleted(System.Net.NetworkInformation.PingCompletedEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Sub OnPingCompleted (e As PingCompletedEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:
 void OnPingCompleted(System::Net::NetworkInformation::PingCompletedEventArgs ^ e);" />
<MemberSignature Language="F#" Value="member this.OnPingCompleted : System.Net.NetworkInformation.PingCompletedEventArgs -> unit" Usage="ping.OnPingCompleted e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Net.NetworkInformation.PingCompletedEventArgs" Index="0" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Net.NetworkInformation.PingCompletedEventArgs" /> object that contains event data.</param>
<summary>Raises the <see cref="E:System.Net.NetworkInformation.Ping.PingCompleted" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Classes that inherit from the <xref:System.Net.NetworkInformation.Ping> class can override this method to perform additional tasks, such as logging the data contained in the `e` parameter.
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/).
The <xref:System.Net.NetworkInformation.Ping.OnPingCompleted%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Net.NetworkInformation.Ping.OnPingCompleted(System.Net.NetworkInformation.PingCompletedEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Net.NetworkInformation.Ping.OnPingCompleted(System.Net.NetworkInformation.PingCompletedEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
</Docs>
</Member>
<Member MemberName="PingCompleted">
<MemberSignature Language="C#" Value="public event System.Net.NetworkInformation.PingCompletedEventHandler PingCompleted;" />
<MemberSignature Language="ILAsm" Value=".event class System.Net.NetworkInformation.PingCompletedEventHandler PingCompleted" />
<MemberSignature Language="DocId" Value="E:System.Net.NetworkInformation.Ping.PingCompleted" />
<MemberSignature Language="VB.NET" Value="Public Custom Event PingCompleted As PingCompletedEventHandler " FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<MemberSignature Language="C++ CLI" Value="public:
 event System::Net::NetworkInformation::PingCompletedEventHandler ^ PingCompleted;" />
<MemberSignature Language="F#" Value="member this.PingCompleted : System.Net.NetworkInformation.PingCompletedEventHandler " Usage="member this.PingCompleted : System.Net.NetworkInformation.PingCompletedEventHandler " />
<MemberSignature Language="VB.NET" Value="Public Event PingCompleted As PingCompletedEventHandler " FrameworkAlternate="netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.NetworkInformation.PingCompletedEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when an asynchronous operation to send an Internet Control Message Protocol (ICMP) echo message and receive the corresponding ICMP echo reply message completes or is canceled.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Applications use the <xref:System.Net.NetworkInformation.Ping.PingCompleted> event to get information about the completion status and data collected by a call to one of the <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> methods. The <xref:System.Net.NetworkInformation.PingCompletedEventHandler> delegate provides the call back method invoked when <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> raises this event.
## Examples
The following code example demonstrates specifying a callback method for the <xref:System.Net.NetworkInformation.Ping.PingCompleted> event. The complete example is available in the <xref:System.Net.NetworkInformation.Ping> class overview.
[!code-cpp[NCLPingAsync#2](~/samples/snippets/cpp/VS_Snippets_Remoting/NclPingAsync/CPP/asyncping.cpp#2)]
[!code-csharp[NCLPingAsync#2](~/samples/snippets/csharp/VS_Snippets_Remoting/NclPingAsync/CS/asyncping.cs#2)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Send">
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Attempts to send an Internet Control Message Protocol (ICMP) echo message to a remote computer and receive a corresponding ICMP echo reply message from the remote computer.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The IP address returned by any of the <xref:System.Net.NetworkInformation.Ping.Send%2A> overloads can originate from a malicious remote computer. Do not connect to the remote computer using this. Use DNS to determine the IP address of the machine to which you want to connect.
]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName="Send">
<MemberSignature Language="C#" Value="public System.Net.NetworkInformation.PingReply Send (System.Net.IPAddress address);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Net.NetworkInformation.PingReply Send(class System.Net.IPAddress address) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.Send(System.Net.IPAddress)" />
<MemberSignature Language="VB.NET" Value="Public Function Send (address As IPAddress) As PingReply" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Net::NetworkInformation::PingReply ^ Send(System::Net::IPAddress ^ address);" />
<MemberSignature Language="F#" Value="member this.Send : System.Net.IPAddress -> System.Net.NetworkInformation.PingReply" Usage="ping.Send address" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.NetworkInformation.PingReply</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.Net.IPAddress" Index="0" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="address">An <see cref="T:System.Net.IPAddress" /> that identifies the computer that is the destination for the ICMP echo message.</param>
<summary>Attempts to send an Internet Control Message Protocol (ICMP) echo message to the computer that has the specified <see cref="T:System.Net.IPAddress" />, and receive a corresponding ICMP echo reply message from that computer.</summary>
<returns>A <see cref="T:System.Net.NetworkInformation.PingReply" /> object that provides information about the ICMP echo reply message, if one was received, or describes the reason for the failure if no message was received.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method sends to the host that is specified by `address` a 32 <xref:System.Byte> data buffer with the ICMP echo message. The method waits five seconds for an ICMP echo reply message. If it does not receive a reply in that time, the method returns and the <xref:System.Net.NetworkInformation.PingReply.Status%2A> property is set to <xref:System.Net.NetworkInformation.IPStatus.TimedOut>.
This overload uses default settings for packet fragmentation and packet forwarding. The packet that contains the ICMP echo message can be fragmented in transit if the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers. To prevent fragmentation, use one of the <xref:System.Net.NetworkInformation.Ping.Send%2A> methods that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> property to `true`. When <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> is `true` and the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers, the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.PacketTooBig>. The packet or packet fragments (if fragmented) can be forwarded by routing nodes 128 times before being discarded. To change this setting, use a <xref:System.Net.NetworkInformation.Ping.Send%2A> overload that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.Ttl%2A> property to the desired value. If the packet does not reach its destination after being forwarded the specified number of times, the packet is discarded and the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.TtlExpired>.
## Examples
The following code example demonstrates calling this method.
[!code-cpp[NCLPingSampler#3](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLPingSampler/CPP/pingtest.cpp#3)]
[!code-csharp[NCLPingSampler#3](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLPingSampler/CS/pingtest.cs#3)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="address" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">A call to <see cref="Overload:System.Net.NetworkInformation.Ping.SendAsync" /> is in progress.</exception>
<exception cref="T:System.Net.NetworkInformation.PingException">An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown.</exception>
<exception cref="T:System.ObjectDisposedException">This object has been disposed.</exception>
</Docs>
</Member>
<Member MemberName="Send">
<MemberSignature Language="C#" Value="public System.Net.NetworkInformation.PingReply Send (string hostNameOrAddress);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Net.NetworkInformation.PingReply Send(string hostNameOrAddress) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.Send(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Function Send (hostNameOrAddress As String) As PingReply" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Net::NetworkInformation::PingReply ^ Send(System::String ^ hostNameOrAddress);" />
<MemberSignature Language="F#" Value="member this.Send : string -> System.Net.NetworkInformation.PingReply" Usage="ping.Send hostNameOrAddress" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.NetworkInformation.PingReply</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="hostNameOrAddress" Type="System.String" Index="0" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="hostNameOrAddress">A <see cref="T:System.String" /> that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address.</param>
<summary>Attempts to send an Internet Control Message Protocol (ICMP) echo message to the specified computer, and receive a corresponding ICMP echo reply message from that computer.</summary>
<returns>A <see cref="T:System.Net.NetworkInformation.PingReply" /> object that provides information about the ICMP echo reply message, if one was received, or provides the reason for the failure, if no message was received.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method sends a 32 <xref:System.Byte> data buffer with the ICMP echo message. The method waits five seconds for an ICMP echo reply message. If it does not receive a reply in that time, the method returns and the <xref:System.Net.NetworkInformation.PingReply.Status%2A> property is set to <xref:System.Net.NetworkInformation.IPStatus.TimedOut>.
This overload uses default settings for packet fragmentation and packet forwarding. The packet that contains the ICMP echo message can be fragmented in transit if the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers. To prevent fragmentation, use one of the <xref:System.Net.NetworkInformation.Ping.Send%2A> methods that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> property to `true`. When <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> is `true` and the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers, the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.PacketTooBig>. The packet or packet fragments (if fragmented) can be forwarded by routing nodes 128 times before being discarded. To change this setting, use a <xref:System.Net.NetworkInformation.Ping.Send%2A> overload that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.Ttl%2A> property to the desired value. If the packet does not reach its destination after being forwarded the specified number of times, the packet is discarded and the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.TtlExpired>.
## Examples
The following code example demonstrates calling this method.
[!code-cpp[NCLPingSampler#2](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLPingSampler/CPP/pingtest.cpp#2)]
[!code-csharp[NCLPingSampler#2](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLPingSampler/CS/pingtest.cs#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="hostNameOrAddress" /> is <see langword="null" /> or is an empty string ("").</exception>
<exception cref="T:System.InvalidOperationException">A call to <see cref="Overload:System.Net.NetworkInformation.Ping.SendAsync" /> is in progress.</exception>
<exception cref="T:System.Net.NetworkInformation.PingException">An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown.</exception>
<exception cref="T:System.ObjectDisposedException">This object has been disposed.</exception>
</Docs>
</Member>
<Member MemberName="Send">
<MemberSignature Language="C#" Value="public System.Net.NetworkInformation.PingReply Send (System.Net.IPAddress address, int timeout);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Net.NetworkInformation.PingReply Send(class System.Net.IPAddress address, int32 timeout) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.Send(System.Net.IPAddress,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function Send (address As IPAddress, timeout As Integer) As PingReply" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Net::NetworkInformation::PingReply ^ Send(System::Net::IPAddress ^ address, int timeout);" />
<MemberSignature Language="F#" Value="member this.Send : System.Net.IPAddress * int -> System.Net.NetworkInformation.PingReply" Usage="ping.Send (address, timeout)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.NetworkInformation.PingReply</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.Net.IPAddress" Index="0" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="timeout" Type="System.Int32" Index="1" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="address">An <see cref="T:System.Net.IPAddress" /> that identifies the computer that is the destination for the ICMP echo message.</param>
<param name="timeout">An <see cref="T:System.Int32" /> value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message.</param>
<summary>Attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified <see cref="T:System.Net.IPAddress" />, and receive a corresponding ICMP echo reply message from that computer. This method allows you to specify a time-out value for the operation.</summary>
<returns>A <see cref="T:System.Net.NetworkInformation.PingReply" /> object that provides information about the ICMP echo reply message if one was received, or provides the reason for the failure if no message was received.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the ICMP echo reply message is not received within the time specified in the `timeout` parameter, the ICMP echo fails, and the <xref:System.Net.NetworkInformation.PingReply.Status%2A> property is set to <xref:System.Net.NetworkInformation.IPStatus.TimedOut>.
> [!NOTE]
> When specifying very small numbers for `timeout`, the Ping reply can be received even if `timeout` milliseconds have elapsed.
This overload uses default settings for packet fragmentation and packet forwarding. The packet that contains the ICMP echo message can be fragmented in transit if the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers. To prevent fragmentation, use one of the <xref:System.Net.NetworkInformation.Ping.Send%2A> methods that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> property to `true`. When <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> is `true` and the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers, the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.PacketTooBig>.
The packet or packet fragments can be forwarded by routing nodes 128 times before being discarded. To change this setting, use a <xref:System.Net.NetworkInformation.Ping.Send%2A> overload that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.Ttl%2A> property to the desired value. If the packet does not reach its destination after being forwarded the specified number of times, the packet is discarded and the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.TtlExpired>.
## Examples
For an example that demonstrates calling a <xref:System.Net.NetworkInformation.Ping.Send%2A> method, see the <xref:System.Net.NetworkInformation.Ping> class overview.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="address" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="timeout" /> is less than zero.</exception>
<exception cref="T:System.InvalidOperationException">A call to <see cref="Overload:System.Net.NetworkInformation.Ping.SendAsync" /> is in progress.</exception>
<exception cref="T:System.Net.NetworkInformation.PingException">An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown.</exception>
<exception cref="T:System.ObjectDisposedException">This object has been disposed.</exception>
</Docs>
</Member>
<Member MemberName="Send">
<MemberSignature Language="C#" Value="public System.Net.NetworkInformation.PingReply Send (string hostNameOrAddress, int timeout);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Net.NetworkInformation.PingReply Send(string hostNameOrAddress, int32 timeout) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.Send(System.String,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function Send (hostNameOrAddress As String, timeout As Integer) As PingReply" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Net::NetworkInformation::PingReply ^ Send(System::String ^ hostNameOrAddress, int timeout);" />
<MemberSignature Language="F#" Value="member this.Send : string * int -> System.Net.NetworkInformation.PingReply" Usage="ping.Send (hostNameOrAddress, timeout)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.NetworkInformation.PingReply</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="hostNameOrAddress" Type="System.String" Index="0" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="timeout" Type="System.Int32" Index="1" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="hostNameOrAddress">A <see cref="T:System.String" /> that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address.</param>
<param name="timeout">An <see cref="T:System.Int32" /> value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message.</param>
<summary>Attempts to send an Internet Control Message Protocol (ICMP) echo message to the specified computer, and receive a corresponding ICMP echo reply message from that computer. This method allows you to specify a time-out value for the operation.</summary>
<returns>A <see cref="T:System.Net.NetworkInformation.PingReply" /> object that provides information about the ICMP echo reply message if one was received, or provides the reason for the failure if no message was received.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the ICMP echo reply message is not received within the time specified in the `timeout` parameter, the ICMP echo fails, and the <xref:System.Net.NetworkInformation.PingReply.Status%2A> property is set to <xref:System.Net.NetworkInformation.IPStatus.TimedOut>.
> [!NOTE]
> When specifying very small numbers for `timeout`, the Ping reply can be received even if `timeout` milliseconds have elapsed.
This overload uses default settings for packet fragmentation and packet forwarding. The packet that contains the ICMP echo message can be fragmented in transit if the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers. To prevent fragmentation, use one of the <xref:System.Net.NetworkInformation.Ping.Send%2A> methods that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> property to `true`. When <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> is `true` and the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers, the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.PacketTooBig>. The packet or packet fragments (if fragmented) can be forwarded by routing nodes 128 times before being discarded. To change this setting, use a <xref:System.Net.NetworkInformation.Ping.Send%2A> overload that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.Ttl%2A> property to the desired value. If the packet does not reach its destination after being forwarded the specified number of times, the packet is discarded and the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.TtlExpired>.
## Examples
For an example that demonstrates calling a <xref:System.Net.NetworkInformation.Ping.Send%2A> method, see the <xref:System.Net.NetworkInformation.Ping> class overview.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="hostNameOrAddress" /> is <see langword="null" /> or is an empty string ("").</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="timeout" /> is less than zero.</exception>
<exception cref="T:System.InvalidOperationException">A call to <see cref="Overload:System.Net.NetworkInformation.Ping.SendAsync" /> is in progress.</exception>
<exception cref="T:System.Net.NetworkInformation.PingException">An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown.</exception>
<exception cref="T:System.ObjectDisposedException">This object has been disposed.</exception>
</Docs>
</Member>
<Member MemberName="Send">
<MemberSignature Language="C#" Value="public System.Net.NetworkInformation.PingReply Send (System.Net.IPAddress address, int timeout, byte[] buffer);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Net.NetworkInformation.PingReply Send(class System.Net.IPAddress address, int32 timeout, unsigned int8[] buffer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.Send(System.Net.IPAddress,System.Int32,System.Byte[])" />
<MemberSignature Language="VB.NET" Value="Public Function Send (address As IPAddress, timeout As Integer, buffer As Byte()) As PingReply" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Net::NetworkInformation::PingReply ^ Send(System::Net::IPAddress ^ address, int timeout, cli::array <System::Byte> ^ buffer);" />
<MemberSignature Language="F#" Value="member this.Send : System.Net.IPAddress * int * byte[] -> System.Net.NetworkInformation.PingReply" Usage="ping.Send (address, timeout, buffer)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Net.NetworkInformation.PingReply</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.Net.IPAddress" Index="0" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="timeout" Type="System.Int32" Index="1" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="buffer" Type="System.Byte[]" Index="2" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="address">An <see cref="T:System.Net.IPAddress" /> that identifies the computer that is the destination for the ICMP echo message.</param>
<param name="timeout">An <see cref="T:System.Int32" /> value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message.</param>
<param name="buffer">A <see cref="T:System.Byte" /> array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes.</param>
<summary>Attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified <see cref="T:System.Net.IPAddress" />, and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation.</summary>
<returns>A <see cref="T:System.Net.NetworkInformation.PingReply" /> object that provides information about the ICMP echo reply message, if one was received, or provides the reason for the failure, if no message was received. The method will return <see cref="F:System.Net.NetworkInformation.IPStatus.PacketTooBig" /> if the packet exceeds the Maximum Transmission Unit (MTU).</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the ICMP echo reply message is not received within the time specified in the `timeout` parameter, the ICMP echo fails, and the <xref:System.Net.NetworkInformation.PingReply.Status%2A> property is set to <xref:System.Net.NetworkInformation.IPStatus.TimedOut>.
> [!NOTE]
> When specifying very small numbers for `timeout`, the Ping reply can be received even if `timeout` milliseconds have elapsed.
This overload uses default settings for packet fragmentation and packet forwarding. The packet that contains the ICMP echo message can be fragmented in transit if the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers. To prevent fragmentation, use one of the <xref:System.Net.NetworkInformation.Ping.Send%2A> methods that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> property to `true`. When <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> is `true` and the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers, the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.PacketTooBig>.
The packet or packet fragments can be forwarded by routing nodes 128 times before being discarded. To change this setting, use a <xref:System.Net.NetworkInformation.Ping.Send%2A> overload that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.Ttl%2A> property to the desired value. If the packet does not reach its destination after being forwarded the specified number of times, the packet is discarded and the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.TtlExpired>.
## Examples
The following code example demonstrates how to call this method.
[!code-cpp[NCLPingSampler#6](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLPingSampler/CPP/pingtest.cpp#6)]
[!code-csharp[NCLPingSampler#6](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLPingSampler/CS/pingtest.cs#6)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The size of <paramref name="buffer" /> exceeds 65500 bytes.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="address" /> is <see langword="null" />.
-or-
<paramref name="buffer" /> is <see langword="null" />, or the <paramref name="buffer" /> size is greater than 65500 bytes.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="timeout" /> is less than zero.</exception>
<exception cref="T:System.InvalidOperationException">A call to <see cref="Overload:System.Net.NetworkInformation.Ping.SendAsync" /> is in progress.</exception>
<exception cref="T:System.Net.NetworkInformation.PingException">An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown.</exception>
<exception cref="T:System.ObjectDisposedException">This object has been disposed.</exception>
</Docs>
</Member>
<Member MemberName="Send">
<MemberSignature Language="C#" Value="public System.Net.NetworkInformation.PingReply Send (string hostNameOrAddress, int timeout, byte[] buffer);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Net.NetworkInformation.PingReply Send(string hostNameOrAddress, int32 timeout, unsigned int8[] buffer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.Send(System.String,System.Int32,System.Byte[])" />
<MemberSignature Language="VB.NET" Value="Public Function Send (hostNameOrAddress As String, timeout As Integer, buffer As Byte()) As PingReply" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Net::NetworkInformation::PingReply ^ Send(System::String ^ hostNameOrAddress, int timeout, cli::array <System::Byte> ^ buffer);" />
<MemberSignature Language="F#" Value="member this.Send : string * int * byte[] -> System.Net.NetworkInformation.PingReply" Usage="ping.Send (hostNameOrAddress, timeout, buffer)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Net.NetworkInformation.PingReply</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="hostNameOrAddress" Type="System.String" Index="0" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="timeout" Type="System.Int32" Index="1" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="buffer" Type="System.Byte[]" Index="2" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="hostNameOrAddress">A <see cref="T:System.String" /> that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address.</param>
<param name="timeout">An <see cref="T:System.Int32" /> value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message.</param>
<param name="buffer">A <see cref="T:System.Byte" /> array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes.</param>
<summary>Attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the specified computer, and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation.</summary>
<returns>A <see cref="T:System.Net.NetworkInformation.PingReply" /> object that provides information about the ICMP echo reply message if one was received, or provides the reason for the failure if no message was received.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the ICMP echo reply message is not received within the time specified in the `timeout` parameter, the ICMP echo fails, and the <xref:System.Net.NetworkInformation.PingReply.Status%2A> property is set to <xref:System.Net.NetworkInformation.IPStatus.TimedOut>.
> [!NOTE]
> When specifying very small numbers for `timeout`, the Ping reply can be received even if `timeout` milliseconds have elapsed.
This overload uses default settings for packet fragmentation and packet forwarding. The packet that contains the ICMP echo message can be fragmented in transit if the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers. To prevent fragmentation, use one of the <xref:System.Net.NetworkInformation.Ping.Send%2A> methods that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> property to `true`. When <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> is `true` and the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers, the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.PacketTooBig>.
The packet or packet fragments can be forwarded by routing nodes 128 times before being discarded. To change this setting, use a <xref:System.Net.NetworkInformation.Ping.Send%2A> overload that takes an `options` parameter, and set the <xref:System.Net.NetworkInformation.PingOptions.Ttl%2A> property to the desired value. If the packet does not reach its destination after being forwarded the specified number of times, the packet is discarded and the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.TtlExpired>.
## Examples
For an example that demonstrates how to call a <xref:System.Net.NetworkInformation.Ping.Send%2A> overload, see the <xref:System.Net.NetworkInformation.Ping> class overview.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The size of <paramref name="buffer" /> exceeds 65500 bytes.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="hostNameOrAddress" /> is <see langword="null" /> or is an empty string ("").
-or-
<paramref name="buffer" /> is <see langword="null" />, or the <paramref name="buffer" /> size is greater than 65500 bytes.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="timeout" /> is less than zero.</exception>
<exception cref="T:System.InvalidOperationException">A call to <see cref="Overload:System.Net.NetworkInformation.Ping.SendAsync" /> is in progress.</exception>
<exception cref="T:System.Net.NetworkInformation.PingException">An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown.</exception>
<exception cref="T:System.ObjectDisposedException">This object has been disposed.</exception>
</Docs>
</Member>
<Member MemberName="Send">
<MemberSignature Language="C#" Value="public System.Net.NetworkInformation.PingReply Send (System.Net.IPAddress address, int timeout, byte[] buffer, System.Net.NetworkInformation.PingOptions? options);" FrameworkAlternate="net-5.0" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Net.NetworkInformation.PingReply Send(class System.Net.IPAddress address, int32 timeout, unsigned int8[] buffer, class System.Net.NetworkInformation.PingOptions options) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.Send(System.Net.IPAddress,System.Int32,System.Byte[],System.Net.NetworkInformation.PingOptions)" />
<MemberSignature Language="VB.NET" Value="Public Function Send (address As IPAddress, timeout As Integer, buffer As Byte(), options As PingOptions) As PingReply" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Net::NetworkInformation::PingReply ^ Send(System::Net::IPAddress ^ address, int timeout, cli::array <System::Byte> ^ buffer, System::Net::NetworkInformation::PingOptions ^ options);" />
<MemberSignature Language="F#" Value="member this.Send : System.Net.IPAddress * int * byte[] * System.Net.NetworkInformation.PingOptions -> System.Net.NetworkInformation.PingReply" Usage="ping.Send (address, timeout, buffer, options)" />
<MemberSignature Language="C#" Value="public System.Net.NetworkInformation.PingReply Send (System.Net.IPAddress address, int timeout, byte[] buffer, System.Net.NetworkInformation.PingOptions options);" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.NetworkInformation.PingReply</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.Net.IPAddress" Index="0" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="timeout" Type="System.Int32" Index="1" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="buffer" Type="System.Byte[]" Index="2" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="options" Type="System.Net.NetworkInformation.PingOptions" Index="3" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="address">An <see cref="T:System.Net.IPAddress" /> that identifies the computer that is the destination for the ICMP echo message.</param>
<param name="timeout">An <see cref="T:System.Int32" /> value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message.</param>
<param name="buffer">A <see cref="T:System.Byte" /> array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes.</param>
<param name="options">A <see cref="T:System.Net.NetworkInformation.PingOptions" /> object used to control fragmentation and Time-to-Live values for the ICMP echo message packet.</param>
<summary>Attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified <see cref="T:System.Net.IPAddress" /> and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation and control fragmentation and Time-to-Live values for the ICMP echo message packet.</summary>
<returns>A <see cref="T:System.Net.NetworkInformation.PingReply" /> object that provides information about the ICMP echo reply message, if one was received, or provides the reason for the failure, if no message was received. The method will return <see cref="F:System.Net.NetworkInformation.IPStatus.PacketTooBig" /> if the packet exceeds the Maximum Transmission Unit (MTU).</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the ICMP echo reply message is not received within the time specified by the `timeout` parameter, the ICMP echo fails, and the <xref:System.Net.NetworkInformation.PingReply.Status%2A> property is set to <xref:System.Net.NetworkInformation.IPStatus.TimedOut>.
> [!NOTE]
> When specifying very small numbers for `timeout`, the Ping reply can be received even if `timeout` milliseconds have elapsed.
If the <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> property is `true` and the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers, the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.PacketTooBig>.
Use the <xref:System.Net.NetworkInformation.PingOptions.Ttl%2A> property to specify the maximum number of times the ICMP echo message can be forwarded before reaching its destination. If the packet does not reach its destination after being forwarded the specified number of times, the packet is discarded and the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.TtlExpired>.
## Examples
The following code example demonstrates how to call this method.
[!code-cpp[NCLPingSampler#5](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLPingSampler/CPP/pingtest.cpp#5)]
[!code-csharp[NCLPingSampler#5](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLPingSampler/CS/pingtest.cs#5)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The size of <paramref name="buffer" /> exceeds 65500 bytes.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="address" /> is <see langword="null" />.
-or-
<paramref name="buffer" /> is <see langword="null" />, or the <paramref name="buffer" /> size is greater than 65500 bytes.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="timeout" /> is less than zero.</exception>
<exception cref="T:System.InvalidOperationException">A call to <see cref="Overload:System.Net.NetworkInformation.Ping.SendAsync" /> is in progress.</exception>
<exception cref="T:System.Net.NetworkInformation.PingException">An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown.</exception>
<exception cref="T:System.ObjectDisposedException">This object has been disposed.</exception>
</Docs>
</Member>
<Member MemberName="Send">
<MemberSignature Language="C#" Value="public System.Net.NetworkInformation.PingReply Send (string hostNameOrAddress, int timeout, byte[] buffer, System.Net.NetworkInformation.PingOptions? options);" FrameworkAlternate="net-5.0" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Net.NetworkInformation.PingReply Send(string hostNameOrAddress, int32 timeout, unsigned int8[] buffer, class System.Net.NetworkInformation.PingOptions options) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.Send(System.String,System.Int32,System.Byte[],System.Net.NetworkInformation.PingOptions)" />
<MemberSignature Language="VB.NET" Value="Public Function Send (hostNameOrAddress As String, timeout As Integer, buffer As Byte(), options As PingOptions) As PingReply" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Net::NetworkInformation::PingReply ^ Send(System::String ^ hostNameOrAddress, int timeout, cli::array <System::Byte> ^ buffer, System::Net::NetworkInformation::PingOptions ^ options);" />
<MemberSignature Language="F#" Value="member this.Send : string * int * byte[] * System.Net.NetworkInformation.PingOptions -> System.Net.NetworkInformation.PingReply" Usage="ping.Send (hostNameOrAddress, timeout, buffer, options)" />
<MemberSignature Language="C#" Value="public System.Net.NetworkInformation.PingReply Send (string hostNameOrAddress, int timeout, byte[] buffer, System.Net.NetworkInformation.PingOptions options);" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.NetworkInformation.PingReply</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="hostNameOrAddress" Type="System.String" Index="0" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="timeout" Type="System.Int32" Index="1" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="buffer" Type="System.Byte[]" Index="2" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="options" Type="System.Net.NetworkInformation.PingOptions" Index="3" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="hostNameOrAddress">A <see cref="T:System.String" /> that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address.</param>
<param name="timeout">An <see cref="T:System.Int32" /> value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message.</param>
<param name="buffer">A <see cref="T:System.Byte" /> array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes.</param>
<param name="options">A <see cref="T:System.Net.NetworkInformation.PingOptions" /> object used to control fragmentation and Time-to-Live values for the ICMP echo message packet.</param>
<summary>Attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the specified computer, and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation and control fragmentation and Time-to-Live values for the ICMP packet.</summary>
<returns>A <see cref="T:System.Net.NetworkInformation.PingReply" /> object that provides information about the ICMP echo reply message if one was received, or provides the reason for the failure if no message was received.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the ICMP echo reply message is not received within the time specified by the `timeout` parameter, the ICMP echo fails, and the <xref:System.Net.NetworkInformation.PingReply.Status%2A> property is set to <xref:System.Net.NetworkInformation.IPStatus.TimedOut>.
> [!NOTE]
> When specifying very small numbers for `timeout`, the Ping reply can be received even if `timeout` milliseconds have elapsed.
If the <xref:System.Net.NetworkInformation.PingOptions.DontFragment%2A> property is `true` and the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers, the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.PacketTooBig>.
Use the <xref:System.Net.NetworkInformation.PingOptions.Ttl%2A> property to specify the maximum number of times the ICMP echo message can be forwarded before reaching its destination. If the packet does not reach its destination after being forwarded the specified number of times, the packet is discarded and the ICMP echo request fails. When this happens, the <xref:System.Net.NetworkInformation.PingReply.Status%2A> is set to <xref:System.Net.NetworkInformation.IPStatus.TtlExpired>.
## Examples
The following code example demonstrates how to call this method.
[!code-cpp[NCLPingSampler#4](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLPingSampler/CPP/pingtest.cpp#4)]
[!code-csharp[NCLPingSampler#4](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLPingSampler/CS/pingtest.cs#4)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The size of <paramref name="buffer" /> exceeds 65500 bytes.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="hostNameOrAddress" /> is <see langword="null" /> or is a zero-length string.
-or-
<paramref name="buffer" /> is <see langword="null" />, or the <paramref name="buffer" /> size is greater than 65500 bytes.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="timeout" /> is less than zero.</exception>
<exception cref="T:System.InvalidOperationException">A call to <see cref="Overload:System.Net.NetworkInformation.Ping.SendAsync" /> is in progress.</exception>
<exception cref="T:System.Net.NetworkInformation.PingException">An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown.</exception>
<exception cref="T:System.ObjectDisposedException">This object has been disposed.</exception>
</Docs>
</Member>
<MemberGroup MemberName="SendAsync">
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Asynchronously attempts to send an Internet Control Message Protocol (ICMP) echo message to a computer, and receive a corresponding ICMP echo reply message from that computer.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
These methods do not cause your application's main thread to block. If you want to block while waiting for the ICMP echo reply message, use the <xref:System.Net.NetworkInformation.Ping.Send%2A> methods.
> [!NOTE]
> The IP address returned by any of the <xref:System.Net.NetworkInformation.Ping.SendAsync%2A> methods can originate from a malicious remote computer. Do not connect to the remote computer using this. Use DNS to determine the IP address of the machine to which you want to connect.
]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName="SendAsync">
<MemberSignature Language="C#" Value="public void SendAsync (System.Net.IPAddress address, object? userToken);" FrameworkAlternate="net-5.0" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SendAsync(class System.Net.IPAddress address, object userToken) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.NetworkInformation.Ping.SendAsync(System.Net.IPAddress,System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Sub SendAsync (address As IPAddress, userToken As Object)" />
<MemberSignature Language="C++ CLI" Value="public:
 void SendAsync(System::Net::IPAddress ^ address, System::Object ^ userToken);" />
<MemberSignature Language="F#" Value="member this.SendAsync : System.Net.IPAddress * obj -> unit" Usage="ping.SendAsync (address, userToken)" />
<MemberSignature Language="C#" Value="public void SendAsync (System.Net.IPAddress address, object userToken);" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Ping</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.Net.IPAddress" Index="0" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="userToken" Type="System.Object" Index="1" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="address">An <see cref="T:System.Net.IPAddress" /> that identifies the computer that is the destination for the ICMP echo message.</param>
<param name="userToken">An object that is passed to the method invoked when the asynchronous operation completes.</param>
<summary>Asynchronously attempts to send an Internet Control Message Protocol (ICMP) echo message to the computer that has the specified <see cref="T:System.Net.IPAddress" />, and receive a corresponding ICMP echo reply message from that computer.</summary>
<remarks>