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()));
 }
Exemple #4
0
 public bool tryGet(ValueAddress point, out EndPoint endp)
 {
     return(points.TryGetValue(point, out endp));
 }
Exemple #5
0
 public bool Contains(ValueAddress point)
 {
     return(points.ContainsKey(point));
 }
Exemple #6
0
 public void Add(ValueAddress point, EndPoint endp)
 {
     points.Add(point, endp);
 }