This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
do i have to supply a port number when start server?
xiaoyi hou
Greenhorn
Joined: May 20, 2001
Posts: 21
posted
0
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
Doug Melzer
Ranch Hand
Joined: Mar 23, 2000
Posts: 51
posted
0
If no port is specified then the default port 1099 is used.
xiaoyi hou
Greenhorn
Joined: May 20, 2001
Posts: 21
posted
0
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
Kunal Aher
Greenhorn
Joined: Apr 07, 2000
Posts: 20
posted
0
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 )
Kunal
xiaoyi hou
Greenhorn
Joined: May 20, 2001
Posts: 21
posted
0
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
Joined: Apr 07, 2000
Posts: 20
posted
0
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
Joined: May 20, 2001
Posts: 21
posted
0
looks like i still thinking in socket when programming rmi
xiaoyi hou
Greenhorn
Joined: May 20, 2001
Posts: 21
posted
0
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?