Esempio n. 1
0
 public DotNetInterface(NetworkInterface n, UdpIPv4Address[] gw, UdpIPv4Address[] uni, UdpIPv4Address[] multi)
 {
     this.name = DotNetInterface.ParseName(n);
     this.linkType = DotNetInterface.ParseLinkType(n);
     this.physicalAddress = DotNetInterface.ParsePhysicalAddress(n);
     this.gatewayAddresses = gw;
     this.unicastAddresses = uni;
     this.multicastAddresses = multi;
 }
Esempio n. 2
0
    public DotNetInterface(NetworkInterface n, UdpIPv4Address[] gw, UdpIPv4Address[] uni, UdpIPv4Address[] multi)
    {
        name = ParseName(n);
        linkType = ParseLinkType(n);
        physicalAddress = ParsePhysicalAddress(n);

        gatewayAddresses = gw;
        unicastAddresses = uni;
        multicastAddresses = multi;
    }
Esempio n. 3
0
 static int Compare(UdpIPv4Address x, UdpIPv4Address y)
 {
     if (x.Packet > y.Packet)
     {
         return(1);
     }
     if (x.Packet < y.Packet)
     {
         return(-1);
     }
     return(0);
 }
Esempio n. 4
0
        public static UdpEndPoint Parse(string endpoint)
        {
            string[] parts = endpoint.Split(':');

            if (parts.Length != 2)
            {
                throw new FormatException("endpoint is not in the correct format");
            }

            UdpIPv4Address address = UdpIPv4Address.Parse(parts[0]);

            return(new UdpEndPoint(address, ushort.Parse(parts[1])));
        }
Esempio n. 5
0
    public Wp8Interface(UdpKit.UdpIPv4Address address)
    {
        unicast = new UdpKit.UdpIPv4Address[1] {
            address
        };

        address.Byte0 = 1;
        gateway       = new UdpKit.UdpIPv4Address[1] {
            address
        };

        address.Byte0 = 255;
        multicast     = new UdpKit.UdpIPv4Address[2] {
            UdpKit.UdpIPv4Address.Broadcast, address
        };
    }
Esempio n. 6
0
        public static UdpSocketMultiplexer CreateMultiplexer <TPlatform, TSerializer> (UdpIPv4Address address, ushort portMin, ushort portMax, UdpConfig config)
            where TPlatform : UdpPlatform, new()
            where TSerializer : UdpSerializer, new()
        {
            if (portMin > portMax)
            {
                throw new ArgumentOutOfRangeException("portMin was larger then portMax");
            }

            List <UdpSocket> sockets = new List <UdpSocket>();

            for (; portMin <= portMax; portMin += 1)
            {
                // create and start socket
                UdpSocket s = Create <TPlatform, TSerializer>(config);
                s.Start(new UdpEndPoint(address, portMin));

                // add to list
                sockets.Add(s);
            }

            return(CreateMultiplexer(sockets.ToArray()));
        }
Esempio n. 7
0
 public static UdpSocketMultiplexer CreateMultiplexer <TPlatform, TSerializer> (UdpIPv4Address address, ushort portMin, ushort portMax)
     where TPlatform : UdpPlatform, new()
     where TSerializer : UdpSerializer, new()
 {
     return(CreateMultiplexer <TPlatform, TSerializer>(address, portMin, portMax, new UdpConfig()));
 }
Esempio n. 8
0
 public UdpEndPoint(UdpIPv4Address address, ushort port)
 {
     this.Address = address;
     this.Port    = port;
 }
Esempio n. 9
0
 public UdpEndPoint (string endpoint) {
     string[] parts = endpoint.Split(':');
     this.Address = new UdpIPv4Address(parts[0]);
     this.Port = ushort.Parse(parts[1]);
 }
Esempio n. 10
0
 static int Compare(UdpIPv4Address x, UdpIPv4Address y)
 {
     if (x.Packet > y.Packet) return 1;
     if (x.Packet < y.Packet) return -1;
     return 0;
 }