Example #1
0
 protected PeerNameRecord(SerializationInfo info, StreamingContext context)
 {
     m_Comment            = info.GetString("_Comment");
     m_Data               = info.GetValue("_Data", typeof(byte[])) as byte[];
     m_EndPointCollection = info.GetValue("_EndpointList", typeof(IPEndPointCollection)) as IPEndPointCollection;
     m_PeerName           = info.GetValue("_PeerName", typeof(PeerName)) as PeerName;
 }
        protected PeerNameRecord(SerializationInfo info, StreamingContext context)
        {
            m_Comment = info.GetString("_Comment");
            m_Data = info.GetValue("_Data", typeof(byte[])) as byte[];
            m_EndPointCollection = info.GetValue("_EndpointList", typeof(IPEndPointCollection)) as IPEndPointCollection;
            m_PeerName  = info.GetValue("_PeerName", typeof(PeerName)) as PeerName;

        }
        public void Ping(HostInfo info)
        {
            var host = Dns.GetHostEntry(info.Uri);
            IPEndPointCollection ips = new IPEndPointCollection();

            host.AddressList?.ToList().ForEach(p => { ips.Add(new IPEndPoint(p, info.Port)); });
            var peerInfo = new PeerEndPointInfo
            {
                LastUpdated      = DateTime.UtcNow,
                PeerUri          = info.Uri,
                PeerIpCollection = ips
            };

            PeerEndPointInformation?.Invoke(info);
        }
Example #4
0
        public void Ping(HostInfo info)
        {
            var Host = Dns.GetHostEntry(info.Uri);
            IPEndPointCollection ips = new IPEndPointCollection();

            //Console.WriteLine($"new peer entered peer endpoint details :");
            Host.AddressList.ToList()?.ForEach(p => { ips.Add(new IEndPoint(p, info.Port)); });//Console.WriteLine($"\t \t \t Endpoint: {p}{Port}"));
            // Console.WriteLine($"yay ! from :{peerUri}");
            var peerInfo = new PeerEndPointInfo
            {
                LastUpdate      = DateTime.UtcNow,
                PeerUri         = info.Uri,
                PeerIpColletion = ips
            };

            PeerEndPointInformation?.Invoke(info);
        }
        /*public PingService(HostInfo info)
         * {
         *  FileServiceHost = info;
         *  ClientHostDetails = new ObservableCollection<HostInfo>();
         * }*/

        public void Ping(HostInfo info)
        {
            var host = Dns.GetHostEntry(info.Uri);
            IPEndPointCollection ips = new IPEndPointCollection();

            host.AddressList.ToList()?.ForEach(p => { ips.Add(new IPEndPoint(p, info.Port)); });
            var peerInfo = new PeerEndpointInfo
            {
                LastUpdated      = DateTime.Now,
                PeerUri          = info.Uri,
                PeerIPCollection = ips
            };

            PeerEndpointInformation?.Invoke(info);

            /*var host = Dns.GetHostEntry(peerUri);
             * Console.WriteLine($"New Peer Entered: Peer Endpoint Details");
             * host.AddressList.ToList()?.ForEach(p => Console.WriteLine($"\t \t \t Endpoint : {p}:{port}"));*/
            // Console.WriteLine($"Yay~! -- {peerUri}");
        }
 public PeerEndPointsCollection(PeerName peer, IPEndPointCollection ipEndPoint)
 {
     PeerHostName  = peer;
     PeerEndPoints = ipEndPoint;
 }