52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
#ifndef _REMOTEPSAPP_CONNECTIONTHREAD_HPP_
|
|
#define _REMOTEPSAPP_CONNECTIONTHREAD_HPP_
|
|
#ifndef _REMOTEPSAPP_REMOTEPROCESSINFO_HPP_
|
|
#include <remotepsapp/remoteprocessinfo.hpp>
|
|
#endif
|
|
#ifndef _THREAD_MESSAGETHREAD_HPP_
|
|
#include <thread/mthread.hpp>
|
|
#endif
|
|
#ifndef _THREAD_MUTEX_HPP_
|
|
#include <thread/mutex.hpp>
|
|
#endif
|
|
|
|
class ConnectionThread : public MessageThread
|
|
{
|
|
public:
|
|
ConnectionThread(void);
|
|
virtual ~ConnectionThread();
|
|
void handleConnect(const String &serverName);
|
|
bool isInConnect(void)const;
|
|
const String &serverName(void)const;
|
|
protected:
|
|
virtual void connectionHandler(RemoteProcessInfo &remoteProcessInfo);
|
|
virtual void errorHandler(void);
|
|
virtual void preConnect(const String &strServerName);
|
|
virtual void preDisconnect(const String &strServerName);
|
|
private:
|
|
enum {MsgConnect};
|
|
ConnectionThread(const ConnectionThread &someConnectionThread);
|
|
ConnectionThread &operator=(const ConnectionThread &someConnectionThread);
|
|
DWORD threadHandler(ThreadMessage &threadMessage);
|
|
void thConnect(const String &strServerName);
|
|
|
|
ThreadCallback<ConnectionThread> mThreadHandler;
|
|
Mutex mConnectionMutex;
|
|
RemoteProcessInfo mRemoteProcessInfo;
|
|
String mStrServerName;
|
|
bool mIsInConnect;
|
|
};
|
|
|
|
inline
|
|
bool ConnectionThread::isInConnect(void)const
|
|
{
|
|
return mIsInConnect;
|
|
}
|
|
|
|
inline
|
|
const String &ConnectionThread::serverName(void)const
|
|
{
|
|
return mStrServerName;
|
|
}
|
|
#endif
|