Beispiel #1
0
 public Locator(IPAddress addr, int port)
 {
     this.port = (uint)port;
     byte[] bytes = addr.GetAddressBytes();
     if (addr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
     {
         this.kind = LocatorKind.LOCATOR_KIND_UDPv4;
         this.address = new byte[16];
         Array.Copy(bytes, 0, this.address, 12, 4);
     }
     else if (addr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
     {
         this.kind = LocatorKind.LOCATOR_KIND_UDPv6;
         this.address = bytes;
     }
     else
     {
         this.kind = LocatorKind.LOCATOR_KIND_INVALID;
         this.address = new byte[16];
     }
 }
Beispiel #2
0
 public Locator(LocatorKind kind, uint port, byte[] address)
 {
     this.kind = kind;
     this.port = port;
     this.address = address;
 }
Beispiel #3
0
        protected byte[] address; //[16];

        public Locator()
        {
            this.kind = LocatorKind.LOCATOR_KIND_INVALID;
            this.address = new byte[16];
        }