public static unsafe ValueAddress ValueAddress(this EndPoint endPoint) { ValueAddress address = new ValueAddress(); var end = (endPoint as IPEndPoint); address.ipaddress = end.Address.toUintAddress(); address.port = (ushort)end.Port; return(address); }
public static unsafe EndPoint toEndPoint(this ValueAddress address) { byte[] addarr = new byte[sizeof(uint)]; fixed(byte *m = addarr) * (uint *)m = address.ipaddress; IPAddress ip = new IPAddress(addarr); return(new IPEndPoint(ip, address.port)); }
public static unsafe IPAddress GetAddress(this ValueAddress address) { return(new IPAddress(address.ipaddress.ToByteArray())); }
public bool tryGet(ValueAddress point, out EndPoint endp) { return(points.TryGetValue(point, out endp)); }
public bool Contains(ValueAddress point) { return(points.ContainsKey(point)); }
public void Add(ValueAddress point, EndPoint endp) { points.Add(point, endp); }