1
0

net-service.h 889 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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,uint64_t& time);
  30. // 网络校时
  31. void net_cali_time(const std::shared_ptr<client>& clt);
  32. // can校时
  33. void can_cali_time(const std::shared_ptr<client>& clt, const int& reader_id);
  34. };
  35. #endif