Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7565705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:13:23+00:00 2026-05-30T14:13:23+00:00

In RMI, I can only get return value by InetSocketAddress address = new InetSocketAddress(hostname,

  • 0

In RMI, I can only get return value by

InetSocketAddress address = new InetSocketAddress(hostname, port);
Server server = Stub.create(Server.class, address);
int return = server.getValue();

But, I can’t get it by

public class Return {
    int value;
}
InetSocketAddress address = new InetSocketAddress(hostname, port);
Server server = Stub.create(Server.class, address);
Return return = new Return();
server.getValue(return);

I know arguments will be serialized and deserialized, but that’s not my question, my question is “why can’t Java emulate a pass-by-reference as a pass by in-out, as was done in C with RPC?”, I think it’s related to java environment.
By in-out I mean in C with RPC, you can get return value by

int return;
rpc.getValue(&return);

Hope now my question is clear.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T14:13:24+00:00Added an answer on May 30, 2026 at 2:13 pm

    Returning additional object proxies would pose an implementation challenge. As things stand, there’s only one way to create a remote object. if methods are allowed to spawn more remote objects just by returning regular objects, then all those calls need to be intercepted, objects properly catalogued, etc.

    In other words, the Java people – unlike , e. g. DCOM people – decided not to do the extra plumbing. And that will always be the answer to the “why is system A unlike system B” quesions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to create an rmi server that can also act as a client,
How can I sniff and analyze Java RMI traffic ? There is only very
somewhere in here I'm using java.rmi.server.UID which is upsetting GAE. After :only'ing my dependencies
I have an RMI server export a single Manager class. The RMI client connects
How can I use RMI with a applet client behind a firewall? How can
For RMI on server-side, do we need to start rmiregistry program, or just call
I have a very simple Java RMI Server that looks like the following: import
I am adapting a little rmi client-server application. I have written several things :
I am writing a very simple RMI server, and I am seeing intermittent java.rmi.NoSuchObjectExceptions
I'm using Spring to handle RMI calls to some remote server. It is straightforward

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.