connection now works

This commit is contained in:
jakani24
2024-03-19 21:46:08 +01:00
parent fd20338513
commit 0195bbbe23
29 changed files with 136 additions and 130 deletions

View File

@@ -3,8 +3,16 @@
"WorkspaceRootPath": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:virus_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:scan.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\thread_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:thread_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\client_backend.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
@@ -14,6 +22,10 @@
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:local_com.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:connect.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
@@ -22,10 +34,6 @@
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_schedule.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:local_schedule.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:virus_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:log.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
@@ -34,14 +42,6 @@
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:check_dir.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:scan.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\thread_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:thread_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:scan.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
@@ -102,47 +102,11 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 11,
"SelectedChildIndex": 12,
"Children": [
{
"$type": "Document",
"DocumentIndex": 21,
"Title": "local_com.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.h",
"RelativeDocumentMoniker": "local_com.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.h",
"RelativeToolTip": "local_com.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAYAAABSAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:49:41.823Z"
},
{
"$type": "Document",
"DocumentIndex": 6,
"Title": "log.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.h",
"RelativeDocumentMoniker": "log.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.h",
"RelativeToolTip": "log.h",
"ViewState": "AQIAAE4AAAAAAAAAAAAAAG4AAAA2AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:47:02.038Z"
},
{
"$type": "Document",
"DocumentIndex": 22,
"Title": "virus_ctrl.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.h",
"RelativeDocumentMoniker": "virus_ctrl.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.h",
"RelativeToolTip": "virus_ctrl.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABAAAAAuAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:45:51.845Z"
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "connect.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.h",
"RelativeDocumentMoniker": "connect.h",
@@ -226,57 +190,121 @@
},
{
"$type": "Document",
"DocumentIndex": 8,
"DocumentIndex": 1,
"Title": "scan.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp",
"RelativeDocumentMoniker": "scan.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp",
"RelativeToolTip": "scan.cpp",
"ViewState": "AQIAAMIAAAAAAAAAAAAkwOkAAAAFAAAA",
"ViewState": "AQIAAH0AAAAAAAAAAAAIwJgAAAAYAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.248Z"
"WhenOpened": "2024-01-28T20:40:06.248Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"DocumentIndex": 5,
"Title": "connect.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp",
"RelativeDocumentMoniker": "connect.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp",
"RelativeToolTip": "connect.cpp",
"ViewState": "AQIAAOMAAAAAAAAAAAAIwAEBAAArAAAA",
"ViewState": "AQIAAM4AAAAAAAAAAAAIwNsAAAAeAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.315Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"DocumentIndex": 3,
"Title": "client_backend.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\client_backend.cpp",
"RelativeDocumentMoniker": "client_backend.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\client_backend.cpp",
"RelativeToolTip": "client_backend.cpp",
"ViewState": "AQIAABIAAAAAAAAAAAAAABQAAAAaAAAA",
"ViewState": "AQIAAFEAAAAAAAAAAAAAAGcAAAAcAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.279Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 9,
"DocumentIndex": 2,
"Title": "thread_ctrl.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\thread_ctrl.cpp",
"RelativeDocumentMoniker": "thread_ctrl.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\thread_ctrl.cpp",
"RelativeToolTip": "thread_ctrl.cpp",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABQAAAAqAAAA",
"ViewState": "AQIAAAwAAAAAAAAAAAAAABwAAAAsAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-13T06:52:01.533Z"
"WhenOpened": "2024-03-13T06:52:01.533Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 7,
"DocumentIndex": 4,
"Title": "local_com.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp",
"RelativeDocumentMoniker": "local_com.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp",
"RelativeToolTip": "local_com.cpp",
"ViewState": "AQIAACoAAAAAAAAAAAAAAAsAAAAXAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-17T16:34:14.678Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "virus_ctrl.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp",
"RelativeDocumentMoniker": "virus_ctrl.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp",
"RelativeToolTip": "virus_ctrl.cpp",
"ViewState": "AQIAAFoAAAAAAAAAAAAIwHcAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-02-18T12:49:41.861Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 22,
"Title": "virus_ctrl.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.h",
"RelativeDocumentMoniker": "virus_ctrl.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.h",
"RelativeToolTip": "virus_ctrl.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABAAAAAuAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:45:51.845Z"
},
{
"$type": "Document",
"DocumentIndex": 8,
"Title": "log.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.h",
"RelativeDocumentMoniker": "log.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.h",
"RelativeToolTip": "log.h",
"ViewState": "AQIAAE4AAAAAAAAAAAAAAG4AAAA2AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:47:02.038Z"
},
{
"$type": "Document",
"DocumentIndex": 21,
"Title": "local_com.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.h",
"RelativeDocumentMoniker": "local_com.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.h",
"RelativeToolTip": "local_com.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAYAAABSAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:49:41.823Z"
},
{
"$type": "Document",
"DocumentIndex": 9,
"Title": "check_dir.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp",
"RelativeDocumentMoniker": "check_dir.cpp",
@@ -334,18 +362,6 @@
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-14T15:55:30.524Z"
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "local_com.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp",
"RelativeDocumentMoniker": "local_com.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp",
"RelativeToolTip": "local_com.cpp",
"ViewState": "AQIAAAkAAAAAAAAAAAAAAC8AAAAXAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-17T16:34:14.678Z"
},
{
"$type": "Document",
"DocumentIndex": 13,
@@ -360,7 +376,7 @@
},
{
"$type": "Document",
"DocumentIndex": 4,
"DocumentIndex": 7,
"Title": "local_schedule.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_schedule.cpp",
"RelativeDocumentMoniker": "local_schedule.cpp",
@@ -369,18 +385,6 @@
"ViewState": "AQIAAAAAAAAAAAAAAAAAAEIAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.279Z"
},
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "virus_ctrl.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp",
"RelativeDocumentMoniker": "virus_ctrl.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp",
"RelativeToolTip": "virus_ctrl.cpp",
"ViewState": "AQIAAFAAAAAAAAAAAAD4v2gAAAA8AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-02-18T12:49:41.861Z"
}
]
}

View File

@@ -86,16 +86,17 @@ int main(int argc, char*argv[]) {
auto start = std::chrono::high_resolution_clock::now();
// Check for tasks from user interface
//printf("checking for tasks from user interface\n");
if (check_for_com_tasks(MAIN_COM, MAIN_COM_PATH) != 0) {
// Log message commented out as this error is expected when the file doesn't exist
// log(LOGLEVEL::ERR, "[main()]:Error opening communication file in: ", MAIN_COM_PATH);
}
//printf("checking for tasks from sched interface\n");
// Check for scheduled tasks
if (check_for_sched_tasks(SCHED, SCHED_PATH) != 0) {
log(LOGLEVEL::ERR, "[main()]:Error opening schedule file in: ", SCHED_PATH);
}
//printf("checking for tasks from run interface\n");
// Execute tasks from the queue
if (can_run_thread()) {
int queue_size = get_queue_size();
@@ -103,7 +104,6 @@ int main(int argc, char*argv[]) {
start_thread(queue_pop());
}
}
// Sleep to ensure loop takes at least 1 second
auto stop = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(stop - start);

View File

@@ -46,6 +46,7 @@ int check_for_com_tasks(const std::string& com_name, const std::string& com_path
std::string command="";
std::string path="";
line=read_from_pipe();
if (line != "") {
std::stringstream ss(line);
if (ss >> command) {
size_t start = line.find("\"") + 1; // Start after the opening quote
@@ -56,6 +57,8 @@ int check_for_com_tasks(const std::string& com_name, const std::string& com_path
}
std::string queue_entry = command + ";" + path;
queue_push(queue_entry.c_str());
return 1;
}
return 0;
}
#endif // !LOCAL_COM_CPP

View File

@@ -11,6 +11,7 @@
int start_thread(const std::string& command) {
if (can_run_thread()) {
bool has_run = 0;
std::string out1, out2;
split(command, ';', out1, out2);
log(LOGLEVEL::INFO_NOSEND, "[start_thread()]: command: ", out1, " arguments: ",out2, " call: ",command);
@@ -20,37 +21,43 @@ int start_thread(const std::string& command) {
// Start a new thread with the scanfile function
std::thread t1(action_scanfile, out2);
t1.detach();
has_run = 1;
}
else if (out1 == "scanfolder") {
// Start a new thread with the scanfolder function
log(LOGLEVEL::INFO, "[start_thread()]: starting scanfolder with arguments: ", out2);
std::thread t1(action_scanfolder, out2);
t1.detach();
has_run = 1;
}
else if (out1 == "update_settings") {
// Start a new thread with the update_settings function
log(LOGLEVEL::INFO, "[start_thread()]: starting update_settings with arguments: ", out2);
std::thread t1(action_update_settings);
t1.detach();
has_run = 1;
}
else if (out1 == "update_db") {
// Start a new thread with the update_db function
log(LOGLEVEL::INFO, "[start_thread()]: starting update_db with arguments: ", out2);
std::thread t1(action_update_db);
t1.detach();
has_run = 1;
}
else if (out1 == "update_system") {
// Start a new thread with the update_db function
log(LOGLEVEL::INFO, "[start_thread()]: starting update_system with arguments: ", out2);
std::thread t1(update_system);
t1.detach();
has_run = 1;
}
if (has_run) {
while (can_run_thread()) {
// Delay a bit to wait until the thread is started
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
}
}
return 0;
}

View File

@@ -2,20 +2,20 @@
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|solutionrelative:connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|C:\\USERS\\JANIS\\DOCUMENTS\\PROJEKTE_MIT_C\\MA\\MA\\SRC\\CLIENT_BACKEND\\WELL_KNOWN.H||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\main.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|solutionrelative:main.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|solutionrelative:connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\connect.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|solutionrelative:connect.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
}
],
"DocumentGroupContainers": [
@@ -25,11 +25,11 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"SelectedChildIndex": 3,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"DocumentIndex": 1,
"Title": "connect.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\connect.cpp",
"RelativeDocumentMoniker": "connect.cpp",
@@ -42,7 +42,7 @@
},
{
"$type": "Document",
"DocumentIndex": 3,
"DocumentIndex": 2,
"Title": "connect.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\connect.h",
"RelativeDocumentMoniker": "connect.h",
@@ -54,7 +54,7 @@
},
{
"$type": "Document",
"DocumentIndex": 1,
"DocumentIndex": 3,
"Title": "well_known.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h",
"RelativeDocumentMoniker": "..\\client_backend\\well_known.h",
@@ -62,20 +62,20 @@
"RelativeToolTip": "..\\client_backend\\well_known.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAQAAAA5AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-17T16:32:22.34Z",
"EditorCaption": ""
"WhenOpened": "2024-03-17T16:32:22.34Z"
},
{
"$type": "Document",
"DocumentIndex": 2,
"DocumentIndex": 0,
"Title": "main.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\main.cpp",
"RelativeDocumentMoniker": "main.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\main.cpp",
"RelativeToolTip": "main.cpp",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABYAAAAEAAAA",
"ViewState": "AQIAAHIAAAAAAAAAAAAAAIQAAAARAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-14T19:45:55.142Z"
"WhenOpened": "2024-03-14T19:45:55.142Z",
"EditorCaption": ""
}
]
}

View File

@@ -1,4 +1 @@
 connect.cpp
C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\connect.cpp(44,11): warning C4101: "dwWritten": Unreferenzierte lokale Variable
LINK : warning LNK4044: Nicht erkannte Option /lOpenGL; wird ignoriert.
client_frontend_guilite.vcxproj -> C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\x64\Debug\client_frontend_guilite.exe
 client_frontend_guilite.vcxproj -> C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\x64\Debug\client_frontend_guilite.exe

View File

@@ -1,2 +0,0 @@
C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\x64\Debug\glfw3.dll
C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\client_f.c434e5ca\x64\Debug\client_f.58F0C424.Up2Date

View File

@@ -131,14 +131,10 @@ void scan_folder(nanogui::Screen* screen, nanogui::Widget* contentWidget, const
if (status == "end")
answered = true;
}
else {
//answered = true;
nanogui::Label* lineLabel10 = new nanogui::Label(contentWidget, "Error: Unable to talk to daemon!\n");
nanogui::Label* lineLabel11 = new nanogui::Label(contentWidget, "------------------------------------------");
screen->performLayout();
}
}
inputFile.close();
Sleep(50);
std::ofstream (ANSWER_COM_PATH);//clear the file
}
// Wait for 1 second before checking again
std::this_thread::sleep_for(std::chrono::seconds(1));