diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-11-09 17:20:11 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-11-09 17:20:11 +0000 |
commit | d534a56d95bca7bdd812be024d9eacba4734e2b7 (patch) | |
tree | f9b98ee2b80e645a7b54e7934882be6c9f73c165 /c++-libbu++/src/gatscon/clientthread.cpp | |
parent | 61ccc86fdf06f12cb72a8b7e65286f812cf62154 (diff) | |
download | libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.gz libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.bz2 libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.xz libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.zip |
Many changes: tabconv'd the C++ code, added a license, BSD, and docs.
Diffstat (limited to '')
-rw-r--r-- | c++-libbu++/src/gatscon/clientthread.cpp | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/c++-libbu++/src/gatscon/clientthread.cpp b/c++-libbu++/src/gatscon/clientthread.cpp index 4c7b72a..4032a50 100644 --- a/c++-libbu++/src/gatscon/clientthread.cpp +++ b/c++-libbu++/src/gatscon/clientthread.cpp | |||
@@ -1,13 +1,20 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2012 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libgats library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include "clientthread.h" | 8 | #include "clientthread.h" |
2 | 9 | ||
3 | #include <bu/tcpsocket.h> | 10 | #include <bu/tcpsocket.h> |
4 | 11 | ||
5 | ClientThread::ClientThread( QObject *pParent, const QByteArray &baHost, | 12 | ClientThread::ClientThread( QObject *pParent, const QByteArray &baHost, |
6 | int iPort ) : | 13 | int iPort ) : |
7 | QThread( pParent ), | 14 | QThread( pParent ), |
8 | baHost( baHost ), | 15 | baHost( baHost ), |
9 | iPort( iPort ), | 16 | iPort( iPort ), |
10 | gsCli( ssCli ) | 17 | gsCli( ssCli ) |
11 | { | 18 | { |
12 | } | 19 | } |
13 | 20 | ||
@@ -17,22 +24,22 @@ ClientThread::~ClientThread() | |||
17 | 24 | ||
18 | void ClientThread::send( Gats::Object *pObj ) | 25 | void ClientThread::send( Gats::Object *pObj ) |
19 | { | 26 | { |
20 | gsCli.writeObject( pObj ); | 27 | gsCli.writeObject( pObj ); |
21 | } | 28 | } |
22 | 29 | ||
23 | void ClientThread::run() | 30 | void ClientThread::run() |
24 | { | 31 | { |
25 | ssCli.setStream( | 32 | ssCli.setStream( |
26 | new Bu::TcpSocket( baHost.constData(), iPort ) | 33 | new Bu::TcpSocket( baHost.constData(), iPort ) |
27 | ); | 34 | ); |
28 | 35 | ||
29 | while( !ssCli.isEos() ) | 36 | while( !ssCli.isEos() ) |
30 | { | 37 | { |
31 | Gats::Object *pObj = gsCli.readObject(); | 38 | Gats::Object *pObj = gsCli.readObject(); |
32 | if( pObj == NULL ) | 39 | if( pObj == NULL ) |
33 | continue; | 40 | continue; |
34 | 41 | ||
35 | emit recv( pObj ); | 42 | emit recv( pObj ); |
36 | } | 43 | } |
37 | } | 44 | } |
38 | 45 | ||