aboutsummaryrefslogtreecommitdiff
path: root/c++-libbu++/src/gatscon/clientthread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++-libbu++/src/gatscon/clientthread.cpp')
-rw-r--r--c++-libbu++/src/gatscon/clientthread.cpp43
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
5ClientThread::ClientThread( QObject *pParent, const QByteArray &baHost, 12ClientThread::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
18void ClientThread::send( Gats::Object *pObj ) 25void ClientThread::send( Gats::Object *pObj )
19{ 26{
20 gsCli.writeObject( pObj ); 27 gsCli.writeObject( pObj );
21} 28}
22 29
23void ClientThread::run() 30void 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