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.

55 lines
1.3 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
7 years ago
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "netClientHandler.h"
  2. #define LOG( X ) m_pLog->Log( "networkClientHandler", 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( "networkClientHandler", this, _LOG_ERROR, _tBfrErrMSG234 );\
  8. }
  9. #else
  10. #define LOG_ERROR( X ) m_pLog->Log( "networkClientHandler", this, _LOG_ERROR, X );
  11. #endif
  12. networkClientHandler::networkClientHandler( int SocketFD, basicEngine *ptr ): basicEventHandler(){
  13. m_pEngine = ptr;
  14. m_pLog = basicLogCollection::getInstance();
  15. m_pPort = NULL;//new serverPort( SocketFD );
  16. #ifdef DEBUG
  17. if( m_pPort ) {
  18. LOG("Client Port Created OK!");
  19. };
  20. #endif
  21. };
  22. networkClientHandler::~networkClientHandler(){
  23. # ifdef DEBUG
  24. LOG("Destructor Start");
  25. # endif
  26. m_pEngine = NULL;
  27. /*
  28. if( m_pPort != NULL ){
  29. # ifdef DEBUG
  30. LOG("Destruct Server Port");
  31. # endif
  32. delete( m_pPort );
  33. # ifdef DEBUG
  34. LOG("Destruct Server Port Done");
  35. # endif
  36. };
  37. */
  38. # ifdef DEBUG
  39. LOG("Destructor Finished");
  40. # endif
  41. };
  42. bool networkClientHandler::attachEngine( basicEngine *ptr ){
  43. if( ptr == NULL ) return false;
  44. m_pEngine = ptr;
  45. return true;
  46. };
  47. #undef LOG
  48. #undef LOG_ERROR