Beispiel #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;
 }
Beispiel #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;
    }
Beispiel #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);
 }
Beispiel #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])));
        }
Beispiel #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
        };
    }
        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()));
        }
 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()));
 }
Beispiel #8
0
 public UdpEndPoint(UdpIPv4Address address, ushort port)
 {
     this.Address = address;
     this.Port    = port;
 }
Beispiel #9
0
 public UdpEndPoint (string endpoint) {
     string[] parts = endpoint.Split(':');
     this.Address = new UdpIPv4Address(parts[0]);
     this.Port = ushort.Parse(parts[1]);
 }
Beispiel #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;
 }