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.
50 lines
770 B
50 lines
770 B
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// nwthread.h is part of TestModbus-Client.
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _NWTHREAD_H_
|
|
#define _NWTHREAD_H_
|
|
|
|
#include <string>
|
|
#include <gtk/gtk.h>
|
|
#include <gdk/gdk.h>
|
|
#include <glib.h>
|
|
|
|
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
|