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

◆ CreatePingReplyFromIcmp6EchoReply()

static PingReply System.Net.NetworkInformation.Ping.CreatePingReplyFromIcmp6EchoReply ( global::Interop::IpHlpApi::Icmp6EchoReply reply,
IntPtr dataPtr,
int sendSize )
inlinestaticprivate

Definition at line 685 of file Ping.cs.

686 {
687 IPAddress address = new IPAddress(reply.Address.Address, reply.Address.ScopeID);
688 IPStatus statusFromCode = GetStatusFromCode((int)reply.Status);
689 long rtt;
690 byte[] array;
691 if (statusFromCode == IPStatus.Success)
692 {
693 rtt = reply.RoundTripTime;
694 array = new byte[sendSize];
695 Marshal.Copy(dataPtr + 36, array, 0, sendSize);
696 }
697 else
698 {
699 rtt = 0L;
700 array = Array.Empty<byte>();
701 }
702 return new PingReply(address, null, statusFromCode, rtt, array);
703 }
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(), and System.L.

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