Skip to content

Commit 181442d

Browse files
committed
creating a preference for defining socket connection timeout
1 parent 2599e46 commit 181442d

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

core/pv-pva/src/main/java/org/phoebus/pv/pva/PVA_Preferences.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public void installPreferences() throws Exception
6565
"epics_pva_server_port",
6666
"epics_pva_broadcast_port",
6767
"epics_pva_conn_tmo",
68+
"epics_pva_tcp_socket_tmo",
6869
"epics_pva_max_array_formatting",
6970
"epics_pva_send_buffer_size"
7071
})

core/pv-pva/src/main/resources/pv_pva_preferences.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ epics_pva_server_port
3737
# Connection timeout in seconds
3838
epics_pva_conn_tmo
3939

40+
# TCP socket creation timeout in seconds
41+
epics_pva_tcp_socket_tmo
42+
4043
# Maximum number of array elements shown when printing data
4144
epics_pva_max_array_formatting
4245

core/pva/src/main/java/org/epics/pva/PVASettings.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ public class PVASettings
212212
*/
213213
public static int EPICS_PVA_CONN_TMO = 30;
214214

215+
/** Socket timeout for TCP connections
216+
*
217+
* TCP socket creation timeout in seconds
218+
*/
219+
public static int EPICS_PVA_TCP_SOCKET_TMO = 30;
220+
215221
/** Maximum number of array elements shown when printing data */
216222
public static int EPICS_PVA_MAX_ARRAY_FORMATTING = 256;
217223

core/pva/src/main/java/org/epics/pva/common/SecureSockets.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public static ServerSocket createServerSocket(final InetSocketAddress address, f
160160
public static Socket createClientSocket(final InetSocketAddress address, final boolean tls) throws Exception
161161
{
162162
initialize();
163-
int connection_timeout = Math.max(1, PVASettings.EPICS_PVA_CONN_TMO) * 1000; // Use EPICS_PVA_CONN_TMO for socket connection timeout, but at least 1 second
163+
int connection_timeout = Math.max(1, PVASettings.EPICS_PVA_TCP_SOCKET_TMO) * 1000; // Use EPICS_PVA_CONN_TMO for socket connection timeout, but at least 1 second
164164

165165
if (!tls) {
166166
Socket socket = new Socket();

0 commit comments

Comments
 (0)