connection-timeout

modbus communication decrease wait time to timeout

有些话、适合烂在心里 提交于 2020-07-21 07:31:06
问题 I'm writing a C++ app that will need to connect to various PLCs over modbus, the IPs of these PLCs is given by user input. Currently when the user puts in an IP that cannot be connected to, my program hangs for around 2 minutes in an attempt to connect and having my app hang for 2 minutes is not an option. An example program illustrates the issue and my attempted fixes: #include <modbus/modbus.h> #include <string> #include <errno.h> #include <iostream> #define PRINT_TIMEVAL(timeval) std::cout

CentOS 6.7 Connection Issues with Docker behind a firewall

本小妞迷上赌 提交于 2020-01-15 08:20:19
问题 Please disregard my incorrect spaces in the links and URLs. I don't have the reputation needed to post > 2 urls or 2 links. I have a new installation of CentOS 6.7 as shown with the uname -a command below: Linux 2.6.32-573.7.1.el6.x86_64 #1 SMP Tue Sep 22 22:00:00 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux This machine is behind a corporate firewall. I have installed docker-io. The version information is (docker version): Client version: 1.7.1 Client API version: 1.19 Go version (client): go1.4

Why JavaMail connection timeout is too long

孤街浪徒 提交于 2020-01-11 20:58:31
问题 In my application I connect to server to authenticate users. This is code: try { Properties prop = new Properties(); prop.put("mail.smtp.starttls.enable","true"); prop.put("mail.smtp.auth", "true"); prop.put("mail.smtp.connectiontimeout", 1000); Session session = Session.getInstance(prop, null); Transport transport = session.getTransport("smtp"); transport.connect("mion.elka.pw.edu.pl", 587, registerLog, registerPass); transport.close(); return true; } catch (NoSuchProviderException ex) {

Why JavaMail connection timeout is too long

回眸只為那壹抹淺笑 提交于 2020-01-11 20:58:15
问题 In my application I connect to server to authenticate users. This is code: try { Properties prop = new Properties(); prop.put("mail.smtp.starttls.enable","true"); prop.put("mail.smtp.auth", "true"); prop.put("mail.smtp.connectiontimeout", 1000); Session session = Session.getInstance(prop, null); Transport transport = session.getTransport("smtp"); transport.connect("mion.elka.pw.edu.pl", 587, registerLog, registerPass); transport.close(); return true; } catch (NoSuchProviderException ex) {

Spring 3.0 RmiProxyFactoryBean: how to set connection timeout?

牧云@^-^@ 提交于 2020-01-05 09:14:10
问题 I need to add "test" functionality for RMI connection (checking if the server on the other side is available/existent). I have created this class/beans: public class MyRmiClientSocketFactory implements RMIClientSocketFactory { private int timeout; public void setTimeout(int timeout) { this.timeout = timeout; } @Override public Socket createSocket(String host, int port) throws IOException { final Socket socket = new Socket(); socket.setSoTimeout(timeout); socket.setSoLinger(false, 0); socket

How can I set the Liquibase database connection timeout and retry count?

社会主义新天地 提交于 2020-01-05 07:20:12
问题 How can I set the time that Liquibase waits to establish a connection to a database server (specifically, PostgreSQL) before failing (i.e. the connection timeout)? How can I set the number of times that Liquibase will attempt to connect to a database server before aborting (i.e. the connection retry count)? 回答1: Liquibase uses a jdbc connection. According to this answer network timeout was only introduced to JDBC from spec 4.1 on. According to postgres jdbc doc there is a property like

SQL connection timeout

南楼画角 提交于 2020-01-04 06:15:15
问题 We have been facing weird connection timeouts on one of our websites. Our environment is composed of an IIS 7 web server (running on Windows Server 2008 R2 Standard Edition) and an SQL Server 2008 database server. When debugging the website functionality that provokes the timeout, we notice that the connection itself takes milliseconds to complete, but the SqlCommand , which invokes a stored procedure on the database, hangs for several minutes during execution, then raises the timeout

How to use signalr in android Service

江枫思渺然 提交于 2019-12-31 03:32:09
问题 I used the signalr library and the problem that is created for me is that when the phone goes to sleep it will issue a connection time out error and will no longer connect to the server. in Activity public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); startService(new Intent(getApplicationContext(), signalRService.class)); }} in Service public class SignalRService extends Service { private

Connection.open for hangs indefinitely, no exception is thrown

萝らか妹 提交于 2019-12-30 06:01:08
问题 When I try to do the following code, the program hangs indefinitely. I don't know why and there seems to be other unanswered topics on the matter. Although, if the IP\website cannot be reached, then it works as intended. private void DoStuff() { string connectionString = "Data Source=www.google.com;Connection Timeout=5"; using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); //Hangs here indefinitely Console.WriteLine("Test"); } } For example, if I set the