///////////////////////////////////////////////////////////////////////////////// // // nwthread.h is part of TestModbus-Client. // ///////////////////////////////////////////////////////////////////////////////// #ifndef _NWTHREAD_H_ #define _NWTHREAD_H_ #include #include #include #include enum { NWT_nothing, NWT_connect, NWT_running, NWT_close }; class NetworkThread { private: GMutex mutex; GThread *thread; int state; std::string host, port; void SetState(int s); void ClientSendStatustext(char* txt); public: NetworkThread(); ~NetworkThread(); void Lock(); void UnLock(); int Connect(std::string dest_host, std::string dest_port); int Disconnect(); int GetState(); void Thread(); }; #endif