aboutsummaryrefslogtreecommitdiff
path: root/src/gatscon/proxythread.h
blob: df7504623a5fb0c51ae7bc6bc61dc75a835c36d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef PROXY_THREAD_H
#define PROXY_THREAD_H

#include <QThread>

#include <bu/streamstack.h>
#include <gats/gatsstream.h>

class ProxyThread : public QThread
{
	Q_OBJECT;
public:
	ProxyThread( QObject *pParent, int iPortIn, const QByteArray &baHostOut,
			int iPortOut );
	virtual ~ProxyThread();

	class ProxyHostThread *pHost;

	void send( Gats::Object *pObj );

signals:
	void recv( Gats::Object *pObj );
	void gotConnection();

protected:
	virtual void run();

private:
	int iPortIn;
	QByteArray baHostOut;
	int iPortOut;

	Bu::StreamStack ssCli;
	Gats::GatsStream gsCli;
};

class ProxyHostThread : public QThread
{
	Q_OBJECT;
public:
	ProxyHostThread( QObject *pParent, ProxyThread *pClient );
	virtual ~ProxyHostThread();

	void send( Gats::Object *pObj );

	void setStream( Bu::Stream *pStr );

signals:
	void recv( Gats::Object *pObj );

protected:
	virtual void run();

private:
	ProxyThread *pClient;
	Bu::StreamStack ssHst;
	Gats::GatsStream gsHst;
};

#endif