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.

57 lines
1.4 KiB

7 years ago
​
7 years ago
​
​
​
7 years ago
​
7 years ago
​
​
​
​
​
7 years ago
​
​
1 year ago
7 years ago
​
​
7 years ago
​
​
​
​
​
​
​
​
1 year ago
7 years ago
​
​
​
7 years ago
​
​
​
​
​
​
​
​
  1. #include "netClientHandler.h"
  2. #define LOG( X ) m_pLog->Log( "NCH", this, X )
  3. #ifdef DEBUG
  4. #define LOG_ERROR( X ) {\
  5. char _tBfrErrMSG234[256];\
  6. sprintf( _tBfrErrMSG234, "In file %s[%d] in func:%s %s",__FILE__, __LINE__, __func__, X );\
  7. m_pLog->Log( "NCH", this, _LOG_ERROR, _tBfrErrMSG234 );\
  8. }
  9. #else
  10. #define LOG_ERROR( X ) m_pLog->Log( "NCH", this, _LOG_ERROR, X );
  11. #endif
  12. networkClientHandler::networkClientHandler( int SocketFD, networkServiceEngine *ptr ): basicEventHandler(){
  13. m_pLog = basicLogCollection::getInstance();
  14. m_pEngine = ptr;
  15. /* Init of Port goes to Top Level Parser!!
  16. m_pPort = new serverPort( SocketFD );
  17. #ifdef DEBUG
  18. if( m_pPort ) {
  19. LOG("Client Port Created OK!");
  20. };
  21. #endif
  22. */
  23. };
  24. networkClientHandler::~networkClientHandler(){
  25. # ifdef DEBUG_EXTRA
  26. LOG("Destructor Start");
  27. # endif
  28. m_pEngine = NULL;
  29. /*
  30. if( m_pPort != NULL ){
  31. # ifdef DEBUG
  32. LOG("Destruct Server Port");
  33. # endif
  34. delete( m_pPort );
  35. # ifdef DEBUG
  36. LOG("Destruct Server Port Done");
  37. # endif
  38. };
  39. */
  40. # ifdef DEBUG_EXTRA
  41. LOG("Destructor Finished");
  42. # endif
  43. };
  44. bool networkClientHandler::attachEngine( networkServiceEngine *ptr ){
  45. if( ptr == NULL ) return false;
  46. m_pEngine = ptr;
  47. return true;
  48. };
  49. #undef LOG
  50. #undef LOG_ERROR