Java RMI communcate through firewall

Source: Internet
Author: User

Subject: Re:basic RMI Port Usage Questions
From: Peter Jones-javasoft East <[log into to unmask]>
Reply-to: Peter Jones-javasoft East <[log into to unmask]>
Date: Fri, Feb 2003 00:09:54-0500
Content-type: Text/plain

>i am attempting a basic usage of RMI between two machine with a firewall >between. The registry and remote application are running on the same machine the >which UNIX OS. The client app runs on Win2000. The Java version is >1.3.1 > >the RMI Registry has been started on port 1510. This port has been opened >through the firewall. However, the connection fails.  We are in the following >behavior: > >there is activity on port 1510 >there is also a attempt to connect on port
2679 which is the SSL sync port.
>why? > >in a configuration where there is no firewall where the RMI connection >succeeds, we observe the RMI serv The ER changes listening ports each time >it is started.
The sequence is: > >the RMI Server starts.
>the client connects on 1510 and then requests a additional port to connect >on.
>the RMI Server provides that information the client. > >what are the implications on the firewall? What ports need toBe opened?

Is >there a way to restrict port usage to one or a few ports. By default, UnicastRemoteObject binds to a anonymous listening port (chosen once per virtual machine instance), but Behavior can is varied in a couple of ways:-Your can tell UnicastRemoteObject explicitly the TCP port to bind to     and to receive calls for a given remote object on. For a remote   implementation class so extends UnicastRemoteObject, this can is   done by using the  Superclass constructor that has a "int" parameter    (which is the TCP port to use). For a remote implementation class   that does is not extend UnicastRemoteObject, this can is done by using &NBSP;&N

The Bsp;the static Unicastremoteobject.exportobject method is the has an "int"   parameter. -Can export a unicastremoteobject with a custom server socket   factory (instance of Java.rmi.server.RMISer Versocketfactory), by   using the UNICASTREMOTEOBJECT constructor or static ExportObject   method that has custom socket factory paraeters. An   rmiserversocketfactory can control the creation of server sockets   objects for remote objects Exp Orted with it, so it can map a   request for a anonymous port (zero) to a specific port value,   rath

Er than an arbitrary one.  The the approach is the easiest if you don't otherwise need to use a custom server socket factory.  (A custom Server socket factory can also is used to limit the network intefaces in, for listen.)

 If you have a custom server socket factory, don ' t forget to override Object.hashcode and object.equals as appropriate:http://developer.java.sun.com/developer/bugParade/bugs/4492317.html
http://java.sun.com/j2se/1.4.1/docs/api/java/rmi/server/RMIClientSocketFactory.html
http://java.sun.com/j2se/1.4.1/docs/api/java/rmi/server/RMIServerSocketFactory.html--Peter ========================================================================== to unsubscribe and send email to  Listserv@java.sun.com and include in the "Signoff rmi-users".

For general help, send email to listserv@java.sun.com and include in the ' message ' Help. For a list of frequently asked RMI questions, please refer to:http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.