Bugfix: sometimes it would not connect via LAN and timed out after 20 seconds.

merge-requests/1/head
Teuniz 2016-10-16 09:38:30 +02:00
rodzic 09aadf8f24
commit f71cde32e2
4 zmienionych plików z 7 dodań i 4 usunięć

Wyświetl plik

@ -35,7 +35,7 @@
#define PROGRAM_NAME "DSRemote"
#define PROGRAM_VERSION "0.32_1610111849"
#define PROGRAM_VERSION "0.32_1610160930"
#define MAX_PATHLEN 4096

Wyświetl plik

@ -39,6 +39,8 @@ lan_connect_thread::lan_connect_thread()
void lan_connect_thread::run()
{
msleep(300);
if(dev_str[0] == 0) return;
device = tmc_open_lan(dev_str);

Wyświetl plik

@ -150,16 +150,15 @@ void UI_Mainwindow::open_connection()
statusLabel->setText("Trying to connect...");
lan_cn_thrd.set_device_address(dev_str);
lan_cn_thrd.start();
sprintf(str, "Trying to connect to %s", dev_str);
msgBox.setIcon(QMessageBox::NoIcon);
msgBox.setText(str);
msgBox.addButton("Abort", QMessageBox::RejectRole);
lan_cn_thrd.set_device_address(dev_str);
connect(&lan_cn_thrd, SIGNAL(finished()), &msgBox, SLOT(accept()));
lan_cn_thrd.start();
if(msgBox.exec() != QDialog::Accepted)
{

Wyświetl plik

@ -155,6 +155,8 @@ struct tmcdev * tmclan_open(const char *ip_address)
{
close(sockfd);
sockfd = -1;
free(tmc_device);
tmc_device = NULL;
return NULL;
}