File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/main/java/com/cisco/trex/stateless Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public class TRexTransport {
1616
1717 private static final Logger LOGGER = LoggerFactory .getLogger (TRexTransport .class );
1818
19- public static final int DEFAULT_RECEIVE_TIMEOUT = 3000 ;
19+ public static final int DEFAULT_TIMEOUT = 3000 ;
2020
2121 private final String connectionString ;
2222
@@ -30,12 +30,13 @@ public class TRexTransport {
3030
3131 private String port ;
3232
33- public TRexTransport (String host , String port , int receiveTimeout ) {
33+ public TRexTransport (String host , String port , int timeout ) {
3434 this .host = host ;
3535 this .port = port ;
3636 zmqSocket = zmqCtx .socket (ZMQ .REQ );
37- int timeout = receiveTimeout == 0 ? DEFAULT_RECEIVE_TIMEOUT : receiveTimeout ;
38- zmqSocket .setReceiveTimeOut (timeout );
37+ int actualTimeout = timeout <= 0 ? DEFAULT_TIMEOUT : timeout ;
38+ zmqSocket .setReceiveTimeOut (actualTimeout );
39+ zmqSocket .setSendTimeOut (actualTimeout );
3940 connectionString = protocol + "://" + this .host +":" + this .port ;
4041 zmqSocket .connect (connectionString );
4142 }
@@ -81,6 +82,7 @@ public String getPort() {
8182
8283 synchronized public void close () {
8384 zmqSocket .disconnect (connectionString );
85+ zmqSocket .close ();
8486 zmqCtx .close ();
8587 }
8688
You can’t perform that action at this time.
0 commit comments