|
95 | 95 | / Open a connection to the specified target host/port with a maximum timeout period. |
96 | 96 | / NOTE: Passwords can be configured to not be printed to via logging |
97 | 97 | / @param hostPort (HostPort) The target process to connect to |
98 | | -/ @param timeout (Integer) The maximum time to wait for a connection. Pass generic null to use the default |
| 98 | +/ @param timeout (Long) The maximum time to wait, in milliseconds, for a connection. Pass generic null to use the default |
99 | 99 | / @return (Integer) The handle to that process if the connection is successful |
100 | 100 | / @throws IllegalArgumentException If the host/port is not of the correct type |
101 | 101 | / @throws ConnectionFailedException If the connection to the process fails |
102 | 102 | / @see .ipc.cfg.defaultConnectTimeout |
103 | 103 | / @see .ipc.cfg.logPasswordsDuringConnect |
104 | 104 | .ipc.connectWithTimeout:{[hostPort;timeout] |
105 | | - $[not .type.isLong timeout; |
| 105 | + $[(::) ~ timeout; |
106 | 106 | timeout:.ipc.cfg.defaultConnectTimeout; |
| 107 | + not .type.isLong timeout; |
| 108 | + '"IllegalArgumentException"; |
107 | 109 | 0 > timeout; |
108 | 110 | '"IllegalArgumentException" |
109 | 111 | ]; |
|
150 | 152 | / Sends a one-shot query to the specified host/port with a specified connection timeout |
151 | 153 | / NOTE: Passwords can be configured to not be printed to via logging |
152 | 154 | / @param hostPort (HostPort) The target process to connect to |
153 | | -/ @param timeout (Integer) The maximum time to wait for a connection. Pass generic null to use the default |
| 155 | +/ @param timeout (Long) The maximum time to wait, in milliseconds, for a connection. Pass generic null to use the default |
154 | 156 | / @return () The result of the query executed on the remote process |
155 | 157 | / @throws IllegalArgumentException If the host/port is not of the correct type |
156 | 158 | / @throws ConnectionFailedException If the connection to the process fails |
157 | 159 | / @see .ipc.cfg.defaultConnectTimeout |
158 | 160 | / @see .ipc.cfg.logPasswordsDuringConnect |
159 | 161 | .ipc.oneShotWithTimeout:{[hostPort; timeout; query] |
160 | | - $[not .type.isLong timeout; |
| 162 | + $[(::) ~ timeout; |
161 | 163 | timeout:.ipc.cfg.defaultConnectTimeout; |
| 164 | + not .type.isLong timeout; |
| 165 | + '"IllegalArgumentException"; |
162 | 166 | 0 > timeout; |
163 | 167 | '"IllegalArgumentException" |
164 | 168 | ]; |
|
0 commit comments