aboutsummaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-06-18 22:44:45 +0000
committerMike Buland <eichlan@xagasoft.com>2007-06-18 22:44:45 +0000
commit33012c4ef4d39efad4fbc2b19f494f5c860fff51 (patch)
tree8bef67016807893f32b5a4d6aa822c65534500a5 /src/client.cpp
parent6f94639a3f5e20e1c635b2d8676086464d7cba2e (diff)
downloadlibbu++-33012c4ef4d39efad4fbc2b19f494f5c860fff51.tar.gz
libbu++-33012c4ef4d39efad4fbc2b19f494f5c860fff51.tar.bz2
libbu++-33012c4ef4d39efad4fbc2b19f494f5c860fff51.tar.xz
libbu++-33012c4ef4d39efad4fbc2b19f494f5c860fff51.zip
The client/server system now works both ways, in and out, and works as well as
the old one in pretty much every way, and better in most. It's much easier to understand. And the atom class is better.
Diffstat (limited to '')
-rw-r--r--src/client.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 6d7d81c..0e48285 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -58,6 +58,15 @@ void Bu::Client::processInput()
58 } 58 }
59} 59}
60 60
61void Bu::Client::processOutput()
62{
63 if( sWriteBuf.getSize() > 0 )
64 {
65 pSocket->write( sWriteBuf.getStr(), sWriteBuf.getSize() );
66 sWriteBuf.clear();
67 }
68}
69
61void Bu::Client::setProtocol( Protocol *pProto ) 70void Bu::Client::setProtocol( Protocol *pProto )
62{ 71{
63 this->pProto = pProto; 72 this->pProto = pProto;
@@ -78,3 +87,19 @@ Bu::FString &Bu::Client::getInput()
78 return sReadBuf; 87 return sReadBuf;
79} 88}
80 89
90Bu::FString &Bu::Client::getOutput()
91{
92 return sWriteBuf;
93}
94
95bool Bu::Client::isOpen()
96{
97 if( !pSocket ) return false;
98 return pSocket->isOpen();
99}
100
101void Bu::Client::write( const char *pData, int nBytes )
102{
103 sWriteBuf.append( pData, nBytes );
104}
105