How do I ensure that RMI uses only a specific set of ports?

后端 未结 4 1161
旧时难觅i
旧时难觅i 2020-12-30 10:36

In our application, we are using RMI for client-server communication in very different ways:

  1. Pushing data from the server to the client to be displayed.
  2. <
4条回答
  •  礼貌的吻别
    2020-12-30 11:14

    You don't need socket factories for this, or even multiple ports. If you're starting the Registry from your server JVM you can use port 1099 for everything, and indeed that is what will happen by default. If you're not starting the registry at all, as in a client callback object, you can provide port 1099 when exporting it.

    The part of your question about 'the client connections back to the server resulting from callbacks' doesn't make sense. They are no different from the original client connections to the server, and they will use the same server port(s).

提交回复
热议问题