Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > RMI Connection questions... (Newbie)

Reply
Thread Tools

RMI Connection questions... (Newbie)

 
 
Agustin Chernitsky
Guest
Posts: n/a
 
      07-02-2003
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.


 
Reply With Quote
 
 
 
 
Agustin Chernitsky
Guest
Posts: n/a
 
      07-02-2003
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/...roperties.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



 
Reply With Quote
 
 
 
 
Joseph Dane
Guest
Posts: n/a
 
      07-03-2003
"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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does java.rmi.Naming not implement interface java.rmi.Registry? Jan Schulze Java 1 03-26-2005 07:45 AM
RMI Vs RMI over IIOP JScoobyCed Java 1 01-28-2005 09:54 AM
RMI, JINI or RMI/IIOP Buu Nguyen Java 1 08-25-2004 11:28 AM
RMI under Linux -> exception: Connection reset =?iso-8859-1?Q?L=E9on?= Planken Java 2 11-17-2003 02:59 PM
RMI Callback; reusing established client to server connection (workaround firewall / NAT) Jo Voordeckers Java 2 09-15-2003 08:21 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57