Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 public static unsafe IPAddress GetAddress(this ValueAddress address)
 {
     return(new IPAddress(address.ipaddress.ToByteArray()));
 }
Ejemplo n.º 4
0
 public bool tryGet(ValueAddress point, out EndPoint endp)
 {
     return(points.TryGetValue(point, out endp));
 }
Ejemplo n.º 5
0
 public bool Contains(ValueAddress point)
 {
     return(points.ContainsKey(point));
 }
Ejemplo n.º 6
0
 public void Add(ValueAddress point, EndPoint endp)
 {
     points.Add(point, endp);
 }