RMI Connection questions... (Newbie)

Discussion in 'Java' started by Agustin Chernitsky, Jul 2, 2003.

  1. Hi Guys,

    I'm starting with RMI (I actually started programming in Java a month ago)
    and I have some questions/doubts:

    1.- Why I don't get any persistent connections? All connections initiated
    from Clients to Server are in a status of TIME_WAIT as soon as there is no
    more interactivity (Remote method invocations) between them. Does this mean
    that every time I invoke a remote method, RMI creates a socket connection??
    Is there a way to make a permanent connection?

    2.- If I register a remote client object reference (a callback) to the
    server, and the pass this remote reference to another client (ie Client A
    registers to Server, the Server gives Client B the ref of A), what will
    happen? A and B will establish a TCP connection directly?

    Well, Any ideas are welcome!!

    Thanks!

    Agustin.
    Agustin Chernitsky, Jul 2, 2003
    #1
    1. Advertising

  2. Hi Joe,

    Thanks a lot for the quick reply! One more thing: Is it safe to use the
    sun.rmi.transport setting? Since I read the Warning sign... about
    standards.. bla bla...

    Anyway, thanks a lot!

    Agustin.

    "Joseph Dane" <> wrote in message
    news:...
    > "Agustin Chernitsky" <> writes:
    >
    > > 1.- Why I don't get any persistent connections? All connections

    initiated
    > > from Clients to Server are in a status of TIME_WAIT as soon as there is

    no
    > > more interactivity (Remote method invocations) between them. Does this

    mean
    > > that every time I invoke a remote method, RMI creates a socket

    connection??
    > > Is there a way to make a permanent connection?

    >
    > connections are persistent, to a point. the default interval after
    > which the connection is closed is pretty short (15 seconds) and can
    > be changed by setting the property sun.rmi.transport.connectionTimeout
    >
    > see this page for descriptions of the sun.rmi properties you can set:
    >
    > http://java.sun.com/j2se/1.4.2/docs/guide/rmi/sunrmiproperties.html
    >
    > > 2.- If I register a remote client object reference (a callback) to the
    > > server, and the pass this remote reference to another client (ie Client

    A
    > > registers to Server, the Server gives Client B the ref of A), what will
    > > happen? A and B will establish a TCP connection directly?

    >
    > yes. the address and port number on Client A are encoded in the stub
    > passed to the server.
    >
    > --
    >
    > joe
    Agustin Chernitsky, Jul 2, 2003
    #2
    1. Advertising

  3. Agustin Chernitsky

    Joseph Dane Guest

    "Agustin Chernitsky" <> writes:

    > Thanks a lot for the quick reply! One more thing: Is it safe to use the
    > sun.rmi.transport setting? Since I read the Warning sign... about
    > standards.. bla bla...


    it's safe, but you'll have to be a little careful. Sun chose to
    publicly document the settings, which is something they don't
    typically do with internal, non-public APIs, because a lot of people
    use their RMI implementation and need to tweak these parameters.

    that said, they put that disclaimer up for a reason. if Sun decides
    to change their implementation, those properties could change, and
    they'd be under no obligation to tell you. I'd say that the
    likelyhood of this is low, though, and anyhow if you stick with a
    single version of Java you'll be safe.

    --

    joe
    Joseph Dane, Jul 3, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jo Voordeckers
    Replies:
    2
    Views:
    857
  2. =?iso-8859-1?Q?L=E9on?= Planken

    RMI under Linux -> exception: Connection reset

    =?iso-8859-1?Q?L=E9on?= Planken, Nov 14, 2003, in forum: Java
    Replies:
    2
    Views:
    6,616
    =?iso-8859-1?Q?L=E9on?= Planken
    Nov 17, 2003
  3. Buu Nguyen

    RMI, JINI or RMI/IIOP

    Buu Nguyen, Aug 25, 2004, in forum: Java
    Replies:
    1
    Views:
    553
    Sudsy
    Aug 25, 2004
  4. JScoobyCed

    RMI Vs RMI over IIOP

    JScoobyCed, Jan 28, 2005, in forum: Java
    Replies:
    1
    Views:
    726
    Dag Sunde
    Jan 28, 2005
  5. Jan Schulze
    Replies:
    1
    Views:
    562
    Esmond Pitt
    Mar 26, 2005
Loading...

Share This Page