View | Details | Raw Unified | Return to bug 62463
Collapse All | Expand All

(-)a/src/core/org/apache/jmeter/samplers/RemoteSampleListenerImpl.java (-2 / +9 lines)
Lines 37-44 public class RemoteSampleListenerImpl extends java.rmi.server.UnicastRemoteObjec Link Here
37
37
38
    private final SampleListener sampleListener;
38
    private final SampleListener sampleListener;
39
    
39
    
40
    private static final int DEFAULT_LOCAL_PORT = 
40
    private static final int DEFAULT_LOCAL_PORT = addOffset(
41
        JMeterUtils.getPropDefault("client.rmi.localport", 0); // $NON-NLS-1$
41
        JMeterUtils.getPropDefault("client.rmi.localport", 0), 2); // $NON-NLS-1$
42
42
43
    public RemoteSampleListenerImpl(Object listener) throws RemoteException {
43
    public RemoteSampleListenerImpl(Object listener) throws RemoteException {
44
        super(DEFAULT_LOCAL_PORT, RmiUtils.createClientSocketFactory(),  RmiUtils.createServerSocketFactory());
44
        super(DEFAULT_LOCAL_PORT, RmiUtils.createClientSocketFactory(),  RmiUtils.createServerSocketFactory());
Lines 54-59 public class RemoteSampleListenerImpl extends java.rmi.server.UnicastRemoteObjec Link Here
54
        }
54
        }
55
    }
55
    }
56
56
57
    private static int addOffset(int port, int offset) {
58
        if (port == 0) {
59
            return 0;
60
        }
61
        return port + offset;
62
    }
63
57
    @Override
64
    @Override
58
    public void testStarted() {
65
    public void testStarted() {
59
        if (testListener != null) {
66
        if (testListener != null) {
(-)a/src/core/org/apache/jmeter/threads/RemoteThreadsListenerImpl.java (-2 / +9 lines)
Lines 49-56 public class RemoteThreadsListenerImpl extends UnicastRemoteObject implements Link Here
49
    /**
49
    /**
50
     * 
50
     * 
51
     */
51
     */
52
    private static final int DEFAULT_LOCAL_PORT = 
52
    private static final int DEFAULT_LOCAL_PORT = addOffset(
53
            JMeterUtils.getPropDefault("client.rmi.localport", 0); // $NON-NLS-1$
53
            JMeterUtils.getPropDefault("client.rmi.localport", 0), 1); // $NON-NLS-1$
54
54
55
    /**
55
    /**
56
     * @throws RemoteException if failed to export object
56
     * @throws RemoteException if failed to export object
Lines 80-85 public class RemoteThreadsListenerImpl extends UnicastRemoteObject implements Link Here
80
        }
80
        }
81
    }
81
    }
82
82
83
    private static int addOffset(int port, int offset) {
84
        if (port == 0) {
85
            return 0;
86
        }
87
        return port + offset;
88
    }
89
83
    /**
90
    /**
84
     * 
91
     * 
85
     * @see RemoteThreadsListener#threadStarted()
92
     * @see RemoteThreadsListener#threadStarted()
(-)a/xdocs/usermanual/remote-test.xml (-4 / +3 lines)
Lines 92-101 there is no need to start RMI registry separately. Link Here
92
To revert to the previous behaviour, define the JMeter property <source>server.rmi.create=false</source> on the server host systems.
92
To revert to the previous behaviour, define the JMeter property <source>server.rmi.create=false</source> on the server host systems.
93
</p>
93
</p>
94
<p>
94
<p>
95
By default, RMI uses a dynamic port for the JMeter server engine. This can cause problems for firewalls,
95
By default, RMI uses dynamic ports for the JMeter server engine. This can cause problems for firewalls,
96
so you can define the JMeter property <code>server.rmi.localport</code> 
96
so you can define the JMeter property <code>server.rmi.localport</code> 
97
to control this port number.
97
to control this port numbers.
98
If this is non-zero, it will be used as the local port number for the server engine.
98
If this is non-zero, it will be used as the base for local port numbers for the server engine. At the moment JMeter will open up to three ports beginning with the port defined in <code>server.rmi.localport</code>.
99
</p>
99
</p>
100
<p><b>Step 2: Add the server IP to your client's Properties File</b></p>
100
<p><b>Step 2: Add the server IP to your client's Properties File</b></p>
101
<p>Edit the properties file <i>on the controlling JMeter machine</i>.  In <code>JMETER_HOME/bin/jmeter.properties</code>,
101
<p>Edit the properties file <i>on the controlling JMeter machine</i>.  In <code>JMETER_HOME/bin/jmeter.properties</code>,
102
- 

Return to bug 62463