• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

do i have to supply a port number when start server?

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does RMI work with port?
because my server is working both with port number and without.
if RMI does work with port, then when the port number is not given, how does client know which port to connect to ?
thanks
X HOU

by the way, can someone recommend some good RMI books
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If no port is specified then the default port 1099 is used.
 
xiaoyi hou
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1099 is the default port of rmiregistry. if i export several server to rmiregistry, does it mean that all the servers listening port 1099?
i'm confused here about rmiregistry's port and the server's port.

X HOU
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
The registry's purpose is just to store and give you a reference to a remote service ( which many call server like chatserver , time server etc ). It listens on the specifed port and serves any requests for a particular service i.e a remote service .There is no question of ur server actually listening on that port.Aslo note that u cannot have 2 services running on the same port
(Correct me if I m wrong )
 
xiaoyi hou
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for you reply. but i still don't understand:
if i start rmiregsitry on port 1099, and i export a chatserver to it, then what is the listening port of the chatserver?
if it is listening 1099, then that means the rmiregistry and the chatserver share a same port, and that's not allowed. (i think the rmiregistry is also a kind of server)
if it is not listening port 1099, since i didn't give it a special port, then how does the chatclient know which port to connect to?
and if i'm not allowed to export more than one server to a single rmiregistry, then does it mean i have to start one rmiregistry for each server i want to run, chatserver, mailserver, etc.
i'm confusing myself here. hopefully it doesn't confuse you.
X HOU

 
Kunal Aher
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your ChatServer neverlistens !! . Its the RMI Registry that is listening to some port for requests . When u bind an object to an registry u just make it available for ur other programs to be remotely accessible . I would advise u to refer to suns RMI Tutorial available at thier site .
Regards
Kunal
PS: Is ur Chatserver listening to some particular port ?? Will u let us know ur app briefly
 
xiaoyi hou
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
looks like i still thinking in socket when programming rmi
 
xiaoyi hou
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i understand that server is never listening any ports now. but when i start coding a SSL RMI program, it's confusing again. here is a API copied from SUN's website:
public static Remote exportObject(Remote obj,
int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
throws RemoteException
Export the remote object to make it available to receive incoming calls, using a transport specified by the given socket factory.
Parameters:
obj - the remote object to be exported
port - the port to export the object on // !!!
csf - the client-side socket factory for making calls to the remote object
ssf - the server-side socket factory for receiving remote calls
Throws:
RemoteException - if export fails
Since:
JDK1.2
what's this "port" for? it must not be 1099, that's the rmiregistry's port. so i give it a random port, but who's gonna use it anyway?

reply
    Bookmark Topic Watch Topic
  • New Topic