Getting the IP address of RMI clients

I have developed an RMI server class and a RMI client class, each with its own Remote Interface.
I want both clients and server to call methods from each other to exchange data.
Here is what I have coded.
The server object starts by creating a Name registry "LocateRegistry.createRegistry(1099)"), and then binds itself to it, using name "server".
On another machine, a client is created. It creates a Name Registry too and binds itself to it (using a unique name).
Then the client asks the server's remote registry for a remote reference to the server (it knows the server's IP adress and it knows that the registry is on port 1099).
It then calls a connect(clientName, clientRegistryPort) remote procedure which provides the server with the client's name and registry port, as the arguments suggests.
The goal is to enable the server to get a remote reference to the client.
But my problem is, to do this the server needs the client's IP address. I am sorry if this looks like a dumb question, but how can the server know the client's IP address ?
Of course the client could send it, but wouldn't it be a more elegant method if the server to found it by itself (after all, a connection is already established since the client has called a method on the server) ? Does RMI provide a method for this ? Do you think that my general solution is correct ?

The goal is to enable the server to get a remote
reference to the client.You don't need a client-side Registry to accomplish that. Just pass a reference to the client-side remote object via a remote method call to the server.

Similar Messages

  • How to get the IP address of RMI server???

    Hi:
    Is there a way to know the IP address of RMI server before client and server connect?
    I am assuming that client didn't know the IP address of the server.
    Because I know that client must hold a server reference so that client can connect to server.
    But I want my client program to find out server IP address before they connect and use this finding to connect to server.
    Is it possible?
    Thanks!

    So you KNOW that the client MUST know where the server is yet you want the client to find out where the server is?
    Simple answer: forget it.
    If you don't know where to connect to how are you ever going to connect to it?
    And if you do know you don't have to go looking it up...
    You can probably do something with JNDI, but then you're only putting off the inevitable as now you need to both know how to contact the JNDI server AND the JNDI server needs to know where the the RMI registry for the service you want to connect to is.

  • Getting the MAC address of the machine

    Is there any method to get the MAC address of machine in java.?????????????
    In our proxy server application we get the IP address of each client connected our proxy server.
    But as the IP addresses are dynamic , we can't trace the location of the machine whenever any client does malicious downloads.

    Thanks It works .
    The code is as follows .
    It works when the machine is connected to internet while throws a null pointer exception when not connected .
    import java.net.InetAddress;
    import java.net.NetworkInterface;
    import java.net.SocketException;
    import java.net.UnknownHostException;
    public class MacAddress {
    public static void main(String[] args) throws SocketException, UnknownHostException {
    try {          
    InetAddress address = InetAddress.getLocalHost();
    * Get NetworkInterface for the current host and then read the
    * hardware address.
    NetworkInterface ni = NetworkInterface.getByInetAddress(address);
    byte[] mac = ni.getHardwareAddress();
    * Extract each array of mac address and convert it to hexa with the
    * following format 08-00-27-DC-4A-9E.
    for (int i = 0; i < mac.length; i++) {
    System.out.format("%02X%s", mac, (i < mac.length - 1) ? "-" : "");
    // System.out.print(mac);
    } catch (UnknownHostException e) {
    e.printStackTrace();     
    } catch (SocketException e) {
    e.printStackTrace();

  • How to get the IP address of the Client machine???

    Hi All,
    I am trying to get the IP address of the Client machine and using the code
    SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') FROM DUAL;
    but this query only return server ip address but i want Client machine IP .
    How can I get that. Please help.

    SowmyRaj wrote:
    Hi All,
    I am trying to get the IP address of the Client machine and using the code
    SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') FROM DUAL;
    but this query only return server ip address but i want Client machine IP .
    How can I get that. Please help.Which client's IP addess?
    SYS_CONTEXT('USERENV','IP_ADDRESS') should give you the IP address of the machine from which the client is connected. So you are running sqlplus from Server?
    To check other session's information, you can check V$SESSION view.

  • Getting the IP address of the client

    How do I get the IP address of the client that makes a request in the Internet?
    getRemoteAddr() cannot be used since the client may be from a proxyserver or an ISP provider ...
    Can I get some help on this?
    Thanks in advance
    Jai

    I think you cannot get the IP address of the client if he uses a proxy server.
    Hope to hear good news from others.
    Regards.
    Jeffrey

  • How to get the IP address of printer USB attached to Time Capsule?

    I'm trying to work a printing problem with my HP7310 Officejet and VMware's Fusion 2.0.3. I'm on Mac OS 10.5.5.
    One of the first diagnostic steps for Fusion is to ping the IP address printer. If I open the Print & Fax dialog from System Preferences I can see the name of my printer, let's say it's called "foo bar". I then open a bash terminal and type: ping "foo bar", but get an "unknown host" message.
    I can ping the Time Capsule itself by getting the IP address from Airport Utility. The printer "foo bar" shows properly in the Airport Utility Printers dialog.
    Anyone have any suggestions?

    If you open AirPort Utility > Manual Setup > Advanced > Logs & Statistics > DHCP clients, a list of the devices will be displayed with their IP addresses. Make note of these.
    You will have to get the IP for your printer by process of elimination. Go to
    System Preferences > Network to see your ethernet and wireless connections and associated IPs. You should be able to narrow the list down to identify your printer.

  • VMclients unable to get the IP address

    We have a anchor Foreign WLAN setup . The SSID is using the L3 webauth security . The SSID is anchored to the anchor controller . The setup is working fine that the clients get the webpage from the anchor controller and the IP as expected . The issue is that VM clients in the nettwork is not able to get the ip address .
    Documents states that this is a limitation of cisco and inorder to overcome the issue we need to enable the Passive client option on the SSID .
    Since we are using the L3 security i am not able to enable the Passive client option .
    Hence i need to configure a SSID with L2 prifile in the anchor foreign setup ( need to get the IP range from the Anchor dynamic interface ) and the VM should get the IP . Please help me to get this done
    thanks in Advance
    Nishad

    Hi Nishad,
    See this post:
    https://supportforums.cisco.com/thread/329343
    https://supportforums.cisco.com/thread/2065405
    https://supportforums.cisco.com/thread/2087163
    Starting in 7.0.116.0, cisco added support for non-cisco WGBs with the  passive client feature on a wlan. This feature will also apply to VMware  and virtual clients -- it is available on the 2100, 2500, 5500 WLCs,  although it is not available on the 4400 series (WISM/3750) due to  architecture limitations.
    you can try enabling the passive client feature on your WLAN to see if this helps resolve the issue.
    Regards

  • Is it possible to get the ip address of the person who logged in a site

    I need to get the IP address of the person who is browsing, i have tried request.getRemoteAddr() which is giving a firewall ip address but not his local system ip. what is the way to find out the ipaddress? should i use any applets or javascript?

    Any way I got it
    How to get the user ip address of client machine who is behind firewall
    use this code
    request.getHeader("x-forwarded-for");to get the local ip address
    InetAddress localadd = InetAddress.getLocalHost();
    localadd.getHostAddress();to get the external ip
    request.getRemoteAddr()and here are few links which ip address discussions are made
    [link1|http://forum.java.sun.com/thread.jspa?threadID=5155243&messageID=9586796]
    [link2|http://forum.java.sun.com/thread.jspa?threadID=5309344&tstart=0]
    thanks to BalusC and RahulSharna

  • How to get the Ip address of machine from which a connection is obtained

    Hi,
    We are using Oracle HA solution and we would use at least 2 Db servers. I would like to know whether there is any way of obtaining the Ip address of the machine from which the connection has been obtained?
    Thanks
    Himadri

    know whether
    there is any way of obtaining the Ip address ofthe
    machine from which the connection has beenobtained?
    Let me get you right. Basically looks like you want
    to get the IP address of the client machines who
    connect to your server? Yes it very much possible.
    Even a simple tool like netstat -a -n display
    the IP addresses/port of remote hosts (clients). Its
    part of the IP protocol to carry the addresses in the
    packets. The question is how do you want to do this
    in java? You should look at
    java.net.ServerSocket.accept().getInetAddress()
    API
    trust it helps,
    -BJNo. I have multiple databases which are used in a Oracle RAC solution. You can obtain connections from more than one DB servers. My question was how to obtain get the IP address of the DB Server from which the connection has been obtained.
    Himadri

  • How to get the ip address of any terminal

    Hi
    Actually, I want to monitor all the users who are connected to the database using toad. Here is the sql statement used:
    SELECT s.SID,
    s.serial#,
    s.command,
    s.machine,
    s.terminal,
    p.spid,
    s.osuser,
    s.program,
    s.USERNAME
    FROM v$process p, v$session s
    WHERE p.addr = s.paddr AND s.program = 'toad.exe'
    ORDER BY s.TERMINAL
    This will give me the name of the terminal, but i need to know about the IP-Address of that particular system.
    Is there any way to get the ip address of any terminal.
    Please suggest me something regarding this.

    Hi,
    See this thread.
    Hi i want to cliente machine name who is accesing the EBS
    Hi i want to cliente machine name who is accesing the EBS
    And, your other thread.
    Is it possible to trace unauthorized users? (via ip address or terminal id)
    Re: Is it possible to trace unauthorized users? (via ip address or terminal
    Regards,
    Hussein

  • Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new one.

    Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new one.

    To change the iCloud ID you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iPhone (if you're using iOS 7), then sign back in with the ID you wish to use.  If you don't know the password for your old ID, or if it isn't accepted, go to https//appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Tap edit next to the primary email account, tap Edit, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iPhone on your device, even though it prompts you for the password for your old account ID. Then go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https//appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • How can I get the MAC address of my Apple TV?

    How can I get the MAC address of my Apple TV? I currently do not have an HDMI device to connect it to, and the MAC is not listed on the box or the Apple TV itself.
    (to answer the obvious, I am trying to pair it with an iPad, and I need to register the Apple TV for the network so the two can see each other)

    As long as I know java doesn't have support to work on link-layer, only internet and transport layers. You may write simple native code. On windows, IP Helper functions, like SendARP allow you to pass an IP address and get the hardware address. You store the hardware address on your database/file and later, when that machine is off, you send a frame to the address you stored previous.
    [http://msdn.microsoft.com/en-us/library/aa366071(VS.85).aspx]
    I haven't seen it on Linux, but if you need help let me know I'll check the Linux API's too.

  • Can I get the IP address of my stolen iPad through find my iPad?

    Hi. My iPad was very recently stolen when my house was burglarized. I have find my iPad turned on and marked the device as lost. Earlier, the iPad was located and the general location was sent to me. Unfortunately, the person who stole it turned it back off as soon as they saw that it was remotely locked (this is a huge problem to me, as a remotely locked device shouldn't be able to be so easily switched off). I told the police where it was located, but it wasn't on long enough to give me an exact location. So, they will not issue a warrant because it could be in one of about 4-5 houses.
    Does anyone know of a way I can get the ip address that was used when the device reported it's location via find my iPad? If I have that, then we can get a warrant and get the police to look for it. It seems like this should be available, as the device was marked as lost under find my iPad. I just can't seem to find the info anywhere on the site.
    If you have any advice, please help.

    You don't need to know the remote IP if you have your PPP setup correctly. Check this site out.
    http://www.stokely.com/unix.serial.port.resources/index.html

  • How to get the Delivery address for PO

    I have a problem.
    I am working on a SAP Script , which is for PO(Zmedruck_po) , which is a copy of
    MEDRUCK.
    I am asked to print the delivery adress in a window .
    The scenario is like this .
    In ME23N , under item details , there is a tab called DELIVERY ADDRESS
    this has option to enter the adress details or a delivery number in the  address text box .
    If the address number is present i have to print that address , else i have to print the address which is entered in the delivery address tab.
    If the delivey address number is there i have no problem in printing it ,But if address number is not there ,I need to know how to get the delivery address,
    is it the plant address, company code address ... ?
    I debuged ,but could not find out.
    Can anyone help please .

    Hi,
    try using the below method:
    Goto TWLAD table with storage location (EKPO-LGORT) as key to get address number (ADDRNUMBER).  then goto ADRC table to get the address of the delivery
    Regards
    Shiva

  • How to get the Url(address) of Next Page in Sequence of Pages in OAF

    Dear All,
    My requirement is to get the next page Url dynamically .
    i have created 2 pages ,first page have button to navigate to the next page ,when i click on first page button ,
    i want to store the url of the next page in column of the database table.
    This is urgent requirement .
    Please suggest .
    Thanks
    Maheswara Raju

    > Is there any way to get the memory address of a
    variable (like int ,float and all) in java.
    No. Chances are excellent that there's a way to do what you want without needing the variable's address, however.
    ~

Maybe you are looking for

  • How (best) to include links in a template?

    I'm creating a ~55 page site, where most of the structure of the site (3 nav bars, etc.) will be similar throughout. I know the client will change the order and names of the links, as well where they point. Yet they want to have it mostly created fir

  • Problem with bloq invoice

    Hi I have the followig problem: We create Sale orders through VA01. Then whe run a Batc input that reads transaccion VF06. The fact is that some Sale ordors are wrong (price, quantity etc) and the batch creates the Invoice. Then we reverse the docume

  • Confidential documents in KM: How to secure individual employee documents

    Hello KM experts! We store W2 documents that we get from a third party as pdf files in a folder in KM. There are a couple of thousand documents every year that we need to store in KM and make them available for employees. The file names are encrypted

  • Deploying application on SunOne Application Server

    Hi, I am trying to deploy a j2ee application on the sun one application server 7.0. However I am getting the following error while trying to deploy the application - "Cannot deploy the component error received from mbean null" I have tried using the

  • Field type not showing correctly

    Hi everyone, I am using a spreadsheet to report on but for some reason the columns are showing in CR as String(255) instead of Number.  I have double checked the spreadsheet format and they seem to be in the number format.  Any ideas what's happening