locked
.Net Remoting - Dynamic IP RRS feed

  • Question

  •  

    Hi All

    I am pretty new to .Net Remoting.
    In all the examples that i had a look, p address of the system is required to connect to the same.

    How can one connect to a PC with dynamic ip in a network, using .Net Remoting ? Is there a way to do this ?

    PLease help.

    Regards
    Sreenu

    Wednesday, July 23, 2008 9:33 AM

Answers

  • This proble has the three solutions:
    1) Usually, any computer with dynamic IPv4/IPv6 address has the own DNS-name. So you can use DNS server to resolve IP address of the machine by it DNS-name. For example:

    var hostEntry = Dns.GetHostEntry("your_computer.com");  
    var addressList = hostEntry.AddressList; 
    Now you have a list of IP-addresses for target machine.
    2) .NET Remoting can accepts DNS-names directly for the endpoint resolution, for example:
    var remoteObj = Activator.GetObject("your_computer.com/object.rem"typeof(YourObject)); 
    3) Any IP package encapsulates into Ethernet frame on the second OSI level. This frame has the MAC address. Any router and switch in the network has own RARP table. ARP is a Reversed ARP. ARP (Address Resolution Protocol) is used for resolving MAC addresses by IP addresses. RARP protocol is used for resolving IP addresses by MAC address. Any NIC has the fixed MAC address. Therefore, computer with dynamic IP address has the fixed MAC address. In this case you can use arp.exe tool (with -a command line) for resolving address or any third-party RARP tool.
    E' più facile spezzare un atomo che un pregiudizio
    Wednesday, July 23, 2008 2:59 PM
  • Thanks Roman - the answer you provided is quite thorough.  Just one thing though,


    2) .NET Remoting can accepts DNS-names directly for the endpoint resolution, for example:
    var remoteObj = Activator.GetObject("your_computer.com/object.rem"typeof(YourObject)); 

    I believe the correct syntax would be: Activator.GetObject(typeof(YourObject), "your_computer.com/object.rem").  I would recommend this for obvious reasons.


    Serialization
    Thursday, July 24, 2008 9:44 PM
    Moderator

All replies

  • This proble has the three solutions:
    1) Usually, any computer with dynamic IPv4/IPv6 address has the own DNS-name. So you can use DNS server to resolve IP address of the machine by it DNS-name. For example:

    var hostEntry = Dns.GetHostEntry("your_computer.com");  
    var addressList = hostEntry.AddressList; 
    Now you have a list of IP-addresses for target machine.
    2) .NET Remoting can accepts DNS-names directly for the endpoint resolution, for example:
    var remoteObj = Activator.GetObject("your_computer.com/object.rem"typeof(YourObject)); 
    3) Any IP package encapsulates into Ethernet frame on the second OSI level. This frame has the MAC address. Any router and switch in the network has own RARP table. ARP is a Reversed ARP. ARP (Address Resolution Protocol) is used for resolving MAC addresses by IP addresses. RARP protocol is used for resolving IP addresses by MAC address. Any NIC has the fixed MAC address. Therefore, computer with dynamic IP address has the fixed MAC address. In this case you can use arp.exe tool (with -a command line) for resolving address or any third-party RARP tool.
    E' più facile spezzare un atomo che un pregiudizio
    Wednesday, July 23, 2008 2:59 PM
  • Thanks Roman - the answer you provided is quite thorough.  Just one thing though,


    2) .NET Remoting can accepts DNS-names directly for the endpoint resolution, for example:
    var remoteObj = Activator.GetObject("your_computer.com/object.rem"typeof(YourObject)); 

    I believe the correct syntax would be: Activator.GetObject(typeof(YourObject), "your_computer.com/object.rem").  I would recommend this for obvious reasons.


    Serialization
    Thursday, July 24, 2008 9:44 PM
    Moderator
  • You right, sorry:)


    E' più facile spezzare un atomo che un pregiudizio
    Saturday, July 26, 2008 10:21 AM
  • Thanks a lot :)
    Sreenu B Kaimal
    Monday, August 11, 2008 12:41 PM