diff --git a/TelescopeDriver/TelescopeDriver.cpp b/TelescopeDriver/TelescopeDriver.cpp index ee857cc..87f2658 100644 --- a/TelescopeDriver/TelescopeDriver.cpp +++ b/TelescopeDriver/TelescopeDriver.cpp @@ -458,6 +458,44 @@ const char *parser(std::string input) { return "Invalid Command"; } +void run_commands(int fd) { + while(1) { + ssize_t bytes_received; + char incoming_data_buffer[1000]; + bytes_received = recv(fd, incoming_data_buffer, 1000, 0); + + if(bytes_received == 0) { + std::cout << "host shut down." << std::endl; + return; + } + if(bytes_received == -1) { + std::cout << "receive error!" << std::endl; + return; + } + + + incoming_data_buffer[bytes_received] = '\0'; + + std::string input = (std::string) incoming_data_buffer; + std::vector commands = separator(input); + //std::cout << commands.size()-1 <