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.

31 lines
675 B

  1. #include "client.hpp"
  2. #include <iostream>
  3. void test(betacore::SHAPE &s, betacore::MODE &m)
  4. {
  5. std::cout
  6. << "Got Shape::"
  7. << betacore::Parser::shape(s)
  8. << "\tFrom"
  9. << betacore::Parser::mode(m)
  10. << std::endl;
  11. }
  12. int main(int argc, char *argv[])
  13. {
  14. std::function<void(betacore::SHAPE & s, betacore::MODE & m)> fn = test;
  15. betacore::Client client(betacore::ALICE, 4444, "localhost", fn);
  16. client.send(false, betacore::TRIANGLE);
  17. client.send(true, betacore::TRIANGLE);
  18. //s.off();
  19. //while(client.running()){}
  20. std::string a;
  21. while (client.running())
  22. {
  23. std::cin >> a;
  24. client.send(false, betacore::TRIANGLE);
  25. if (a == "q")
  26. client.kill();
  27. }
  28. return 0;
  29. }