Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RMI Fixed Server Communication Port

843793Nov 3 2009 — edited Feb 14 2010
Dear Everyone,

I apologize if this has been answered already. I have searched the forums extensively and found no solution, however, the problem might be described differently than I am thinking.

Here is the situation:

I have an application utilizing RMI Callback. I have successfully implemented a custom RMIServerSocket to force my server to listen on a fixed port, and I have successfully implemented a custom RMIClientSocket to ensure that my client will communicate with the server on this fixed port. This works flawlessly. I would like to know if it is possible to force my server application to perform RMI Callback to the client utilizing a fixed port as well. Essentially, I would like all server communications to originate from a single, fixed port back to the client. The destination port does not matter, I am concerned with the source port on the server application.

In a diagram:

Current:
Client (port <random1> ---> Server (port 52520)
Client (port <random1> <--- Server (port <random2>)

Desired:
Client (port <random1> ---> Server (port 52520)
Client (port <random1> <--- Server (port 52521)

I admit freely that I am a new java developer, and have extremely limited experience with RMI. I would greatly appreciate any clear, concise, and pointed advice on this matter. If the question has been answered elsewhere, please point me to it.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 14 2010
Added on Nov 3 2009
6 comments
813 views