udp_node_lst.h 1.2 KB

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include "net/define.h"
  3. #if USE_NET_UDP_NODE
  4. #include "HPSocket/HPSocket.h"
  5. #include <string>
  6. namespace ylib
  7. {
  8. namespace network
  9. {
  10. namespace udp
  11. {
  12. class node;
  13. class node_lst :public CUdpNodeListener
  14. {
  15. public:
  16. node_lst(ylib::network::udp::node* node);
  17. ~node_lst();
  18. private:
  19. virtual EnHandleResult OnPrepareListen(IUdpNode* pSender, SOCKET soListen);
  20. virtual EnHandleResult OnSend(IUdpNode* pSender, LPCTSTR lpszRemoteAddress, USHORT usRemotePort, const BYTE* pData, int iLength);
  21. virtual EnHandleResult OnReceive(IUdpNode* pSender, LPCTSTR lpszRemoteAddress, USHORT usRemotePort, const BYTE* pData, int iLength);
  22. virtual EnHandleResult OnError(IUdpNode* pSender, EnSocketOperation enOperation, int iErrorCode, LPCTSTR lpszRemoteAddress, USHORT usRemotePort, const BYTE* pBuffer, int iLength);
  23. virtual EnHandleResult OnShutdown(IUdpNode* pSender);
  24. private:
  25. ylib::network::udp::node* m_node = nullptr;
  26. };
  27. }
  28. }
  29. }
  30. #endif