Exemplo n.º 1
0
        QueryAnswered
        (
            DNSSDService service,
            DNSSDFlags flags,
            uint ifIndex,
            String fullName,
            DNSSDRRType rrtype,
            DNSSDRRClass rrclass,
            Object rdata,
            uint ttl
        )
        {
            //
            // Stop the resolve to reduce the burden on the network
            //
            m_resolver.Stop();
            m_resolver = null;

            PeerData peer = (PeerData)comboBox1.SelectedItem;
            uint     bits = BitConverter.ToUInt32((Byte[])rdata, 0);

            System.Net.IPAddress address = new System.Net.IPAddress(bits);

            peer.Address = address;
        }
Exemplo n.º 2
0
        // QueryAnswered
        //
        // Called by DNSServices core as a result of DNSService.QueryRecord()
        public void QueryAnswered(DNSSDService service, DNSSDFlags flags, uint ifIndex, String fullName, DNSSDRRType rrtype, DNSSDRRClass rrclass, Object rdata, uint ttl)
        {
            m_resolver.Stop();
            m_resolver = null;

            PeerData peer = this.selectedPeer;

            uint bits = BitConverter.ToUInt32((Byte[])rdata, 0);
            System.Net.IPAddress address = new System.Net.IPAddress(bits);

            peer.Address = address;

            try
            {
                IPEndPoint ipe = new IPEndPoint(address, peer.Port);
                m_socket.Connect(ipe);
                m_socket.BeginReceive(m_buffer, 0, BUFFER_SIZE, 0, new AsyncCallback(this.OnReadSocket), this);
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.Message);
            }
        }
Exemplo n.º 3
0
        //
        // QueryAnswered
        //
        // Called by DNSServices core as a result of DNSService.QueryRecord()
        // call
        //
        public void QueryAnswered(
            DNSSDService    service, 
            DNSSDFlags      flags,
            uint            ifIndex,
            String          fullName,
            DNSSDRRType     rrtype,
            DNSSDRRClass    rrclass,
            Object          rdata,
            uint            ttl
            )
        {
            m_resolver.Stop();

            m_resolver = null;

            PeerData peer = (PeerData) comboBox1.SelectedItem;

            uint bits = BitConverter.ToUInt32( (Byte[])rdata, 0);
            System.Net.IPAddress address = new System.Net.IPAddress(bits);

            peer.Address = address;
        }
 private static void EventManager_QueryRecordAnswered(DNSSDService service, DNSSDFlags flags, uint ifIndex, string fullname, DNSSDRRType rrtype, DNSSDRRClass rrclass, object rdata, uint ttl)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 5
0
 private void M_eventManager_QueryRecordAnswered(DNSSDService service, DNSSDFlags flags, uint ifIndex, string fullname, DNSSDRRType rrtype, DNSSDRRClass rrclass, object rdata, uint ttl)
 {
     if (rdata is byte[])
     {
         IPAddress addr = new IPAddress(rdata as byte[]);
     }
 }