Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lfr_socket_main.cpp 828B

123456789101112131415161718192021222324252627282930313233
  1. #include "lfr_socket.h"
  2. int main()
  3. {
  4. std::mutex mutex;
  5. LFR_Socket socket([&](std::exception const &ex)
  6. {
  7. std::unique_lock<std::mutex> lock(mutex);
  8. std::cerr<<"socket exception:"<<ex.what()<<std::endl;
  9. return false;
  10. });
  11. socket.addListener([&](LFR_Socket::LFR_Telegram telegram)
  12. {
  13. std::unique_lock<std::mutex> lock(mutex);
  14. std::cout << telegram;
  15. }, &mutex);
  16. socket.startLoop();
  17. //send(new_socket, "Hello from the server", sizeof("Hello from the server"), 0);
  18. char input;
  19. std::cout << "fress q to quit" << std::endl;
  20. std::cin >> input;
  21. std::cout << "cinned" << std::endl;
  22. while (input != 'q')
  23. {
  24. std::cin >> input;
  25. std::cout << "cinned" << std::endl;
  26. }
  27. std::cout << "im out" << std::endl;
  28. return 0;
  29. }