LNAcceptor.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include <Acceptor.h>
  3. #include "LNContext.h"
  4. #include <list>
  5. #include <mutex>
  6. class CLNAcceptor
  7. : public CAcceptor<CLNContext>
  8. {
  9. public:
  10. CLNAcceptor(CProtocolHandler *);
  11. virtual ~CLNAcceptor(void);
  12. friend class CLNHandle;
  13. virtual CLNContext* make_handler();
  14. void Lock() { cs.Lock(); }
  15. void Unlock() { cs.Unlock(); }
  16. virtual void OnClearContext(); //땍珂헌뇜졍쌈
  17. void ClearAllContexts(); //헌뇜杰唐졍쌈
  18. int GetContextNum();
  19. //꿴冷졍쌈
  20. CLNContext* FindContext(DWORD_PTR pContext);
  21. CLNContext* FindContextByIMEI(const char *imei);
  22. void SendDataAllContexts(uint8_t* data, size_t len);
  23. CLNContext* FindContextByIVU(const char *imei);
  24. void GetAllContextImei(std::list<CString>& lst);
  25. int validate_connection(const ACE_Asynch_Accept::Result& result, const ACE_INET_Addr& remote, const ACE_INET_Addr& local) override;
  26. protected:
  27. CCriticalSection cs;
  28. std::list<CLNContext*> m_lstClientContext;
  29. CProtocolHandler *m_pHandler = nullptr;
  30. };