1 2 /* 3 * xstress - xk0derz SMTP Stress Tester 4 * 5 * (c) Amit Singh amit@xkoder.com 6 * http://xkoder.com 7 * 8 * This software and related files are licensed under GNU GPL version 2 9 * Please visit the following webpage for more details 10 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 */ 12 13 #ifndef __THREAD_H__ 14 #define __THREAD_H__ 15 16 #include "config.h" 17 #include "sendmail.h" 18 19 /*Thread class*/ 20 class Thread 21 { 22 unsigned long ulLastTS; 23 unsigned int uiTimeoutCounter; 24 int id; 25 int iSockFd; 26 unsigned long int uiMailsToSend; 27 unsigned long int uiNotSent; 28 unsigned long int uiMailsSend; 29 Config *configObj; 30 SendMail mailObj; 31 int iOkay; 32 unsigned int uiEventToPoll; 33 unsigned int uiReportCnt; 34 35 void createSocket(); 36 void closeSocket(); 37 38 public: 39 Thread(void); 40 Thread(int _id, int _mailsToSend, Config *_configObj); 41 42 void process(); 43 int okay(); 44 void initThread(int _id, int _mailsToSend, Config *_configObj); 45 void initMailObj(); 46 int finished(); 47 int getid(); 48 void writeStatus(); 49 void reportStatus(); 50 void stop(int iSig); 51 52 ~Thread(); 53 54 }; 55 #endif