start sea server even remotely over ssh
this works on neutron instruments (account equal host) and on linse-c
This commit is contained in:
13
sicsconn.cpp
13
sicsconn.cpp
@ -173,6 +173,7 @@ SicsConnection::SicsConnection(QObject *parent) : QObject(parent) {
|
||||
bufline = "";
|
||||
bufstate = buf_got_line;
|
||||
connect_state = connect_start;
|
||||
tries_wait_start = 0;
|
||||
command2send = "";
|
||||
tmo = 0;
|
||||
if (!sigpipe_ignored) {
|
||||
@ -246,8 +247,9 @@ int SicsConnection::handleBuffer(int tmo) {
|
||||
iret = SicsConnectSuccess(fd);
|
||||
if (iret <= 0) {
|
||||
if (startServer) {
|
||||
iret = system(startServer);
|
||||
if (iret) {
|
||||
int isys = system(startServer);
|
||||
tries_wait_start = 3;
|
||||
if (isys) {
|
||||
printf("can not connect to sea and failed to start the sea server\n");
|
||||
printf("\n");
|
||||
pos = strcspn(hostport, ":");
|
||||
@ -255,10 +257,13 @@ int SicsConnection::handleBuffer(int tmo) {
|
||||
printf("\n");
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
iret = 1;
|
||||
}
|
||||
startServer = NULL;
|
||||
if (iret == 0) return iret; /* connection pending */
|
||||
if (tries_wait_start > 0) {
|
||||
tries_wait_start--;
|
||||
connect_state = connect_start;
|
||||
}
|
||||
return iret;
|
||||
}
|
||||
connect_state = connect_login;
|
||||
|
Reference in New Issue
Block a user