Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreatePingReplyFromIcmpEchoReply()

static PingReply System.Net.NetworkInformation.Ping.CreatePingReplyFromIcmpEchoReply ( global::Interop::IpHlpApi::IcmpEchoReply reply)
inlinestaticprivate

Definition at line 662 of file Ping.cs.

663 {
664 IPAddress address = new IPAddress(reply.address);
665 IPStatus statusFromCode = GetStatusFromCode((int)reply.status);
666 long rtt;
667 PingOptions options;
668 byte[] array;
669 if (statusFromCode == IPStatus.Success)
670 {
671 rtt = reply.roundTripTime;
672 options = new PingOptions(reply.options.ttl, (reply.options.flags & 2) > 0);
673 array = new byte[reply.dataSize];
674 Marshal.Copy(reply.data, array, 0, reply.dataSize);
675 }
676 else
677 {
678 rtt = 0L;
679 options = null;
680 array = Array.Empty<byte>();
681 }
682 return new PingReply(address, options, statusFromCode, rtt, array);
683 }
static IPStatus GetStatusFromCode(int statusCode)
Definition Ping.cs:653
static void Copy(int[] source, int startIndex, IntPtr destination, int length)
Definition Marshal.cs:800

References System.array, System.Runtime.InteropServices.Marshal.Copy(), System.Net.NetworkInformation.Ping.GetStatusFromCode(), System.L, and System.options.

Referenced by System.Net.NetworkInformation.Ping.CreatePingReply().