net-service.h 960 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * @file
  3. * @brief
  4. * @version
  5. * @author
  6. * @date
  7. * @note
  8. * @warning
  9. * @bug
  10. * @copyright
  11. * */
  12. #ifndef __net_service_hpp__
  13. #define __net_service_hpp__
  14. #include <znet.h>
  15. #include <zstream.h>
  16. struct client;
  17. struct worker;
  18. struct tdoa_sync;
  19. struct net_service:service_callback
  20. {
  21. worker* m_loc_worker;
  22. tdoa_sync*m_sync_worker;
  23. net_service();
  24. ~net_service();
  25. void on_message(const std::shared_ptr<client> &clt,const char*data,size_t len);
  26. void on_timer();
  27. void on_connect(const std::shared_ptr<client> &clt);
  28. int32_t parse_data_anchor(const std::shared_ptr<client>& clt, zistream& s);
  29. int32_t parse_data_anchor_opt(const std::shared_ptr<client>& clt, zistream& s);
  30. int32_t parse_data_anchor_lora(const std::shared_ptr<client>& clt, zistream& s);
  31. // 网络校时
  32. void net_cali_time(const std::shared_ptr<client>& clt);
  33. // can校时
  34. void can_cali_time(const std::shared_ptr<client>& clt, const int& reader_id);
  35. };
  36. #endif