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.

56 lines
1.3 KiB

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_pLog = basicLogCollection::getInstance();
  14. LOG("CHPOK");
  15. m_pEngine = ptr;
  16. m_pPort = new serverPort( SocketFD );
  17. #ifdef DEBUG
  18. if( m_pPort ) {
  19. LOG("Client Port Created OK!");
  20. };
  21. #endif
  22. };
  23. networkClientHandler::~networkClientHandler(){
  24. # ifdef DEBUG
  25. LOG("Destructor Start");
  26. # endif
  27. m_pEngine = NULL;
  28. /*
  29. if( m_pPort != NULL ){
  30. # ifdef DEBUG
  31. LOG("Destruct Server Port");
  32. # endif
  33. delete( m_pPort );
  34. # ifdef DEBUG
  35. LOG("Destruct Server Port Done");
  36. # endif
  37. };
  38. */
  39. # ifdef DEBUG
  40. LOG("Destructor Finished");
  41. # endif
  42. };
  43. bool networkClientHandler::attachEngine( basicEngine *ptr ){
  44. if( ptr == NULL ) return false;
  45. m_pEngine = ptr;
  46. return true;
  47. };
  48. #undef LOG
  49. #undef LOG_ERROR