• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiplexing an RMI connection using secure socket.  RSS feed

 
lui_juin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a client and a server using RMI for communication. The communication is made secure using a SecureSocetFactory. I have more than one client connecting to this server, but I only want to have one port (actually two because 1099 is used for the RMI) open. Each of the clients first make a login which then returns a remote object. When I try to export this object to the same port as the other I get an exception telling med that this port is already taken so obviously I will have to do this in another way. But how?
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I understand; it sounds like you're saying you want to export the object received by the client. That can't be write.
You only need to export the remote object itself one time. That piece is just being used to enable receipt of remote requests. The port for rmiregistry (1099) is just the location of the lookup service; your remote objects are bound to this address so that when client's calling it through Naming.lookup(), they receive a separate socket to conduct communication with the service.
If you want to make multiple objects remotely available, then bind() each one to the registry with a different service name. But you shouldn't need the same object type bound to the server; object instancing covers that for you.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lui_juin: please also review JavaRanch's naming policy. We ask that you post your full name. There is no need for underscores or other punctuation to create a word with no whitespace; the site's parser will handle it without a problem. Thanks for your cooperation.
 
Lui Juin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1-Thanks for answers.
2-I've got my name right now
3-I'll try to explaine things a bit more clearly.
I have a server and a client using SecureConnection. The id�a is that the client logs into the server and get a remote object in return on successfull login. The client will use this object when exchanging other information with the server. All of this is working when the object return from the server is exported with an anonymous port (thus a random port). But what I whould like is that all these objects that returned share the same port. Is this possible, and if not what is the second best sollution?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!