File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
oncrpc4j-rpcgen/src/test/java/org/dcache/oncrpc4j/rpcgen Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
package org .dcache .oncrpc4j .rpcgen ;
2
2
3
- import java .net .InetSocketAddress ;
4
3
import org .dcache .oncrpc4j .rpc .net .IpProtocolType ;
5
4
import org .dcache .oncrpc4j .rpc .OncRpcProgram ;
6
5
import org .dcache .oncrpc4j .rpc .OncRpcSvc ;
@@ -15,7 +14,7 @@ public abstract class AbstractCalculatorTest {
15
14
protected OncRpcSvc server ;
16
15
protected CalculatorClient client ;
17
16
protected String address = "127.0.0.1" ;
18
- protected int port = 0 ;
17
+ volatile protected int port = 0 ;
19
18
20
19
@ Before
21
20
public void setup () throws Exception {
@@ -29,11 +28,11 @@ public void setup() throws Exception{
29
28
server .register (new OncRpcProgram (Calculator .CALCULATOR , Calculator .CALCULATORVERS ), serverImpl );
30
29
server .start ();
31
30
32
- InetSocketAddress sockAddr = server .getInetSocketAddress (IpProtocolType .TCP );
31
+ port = server .getInetSocketAddress (IpProtocolType .TCP ). getPort ( );
33
32
34
33
client = new CalculatorClient (
35
34
InetAddress .getByName (address ),
36
- sockAddr . getPort () ,
35
+ port ,
37
36
Calculator .CALCULATOR ,
38
37
Calculator .CALCULATORVERS ,
39
38
IpProtocolType .TCP );
You can’t perform that action at this time.
0 commit comments