diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-06-18 22:44:45 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-06-18 22:44:45 +0000 |
commit | 33012c4ef4d39efad4fbc2b19f494f5c860fff51 (patch) | |
tree | 8bef67016807893f32b5a4d6aa822c65534500a5 /src/client.cpp | |
parent | 6f94639a3f5e20e1c635b2d8676086464d7cba2e (diff) | |
download | libbu++-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 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 25 |
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 | ||
61 | void Bu::Client::processOutput() | ||
62 | { | ||
63 | if( sWriteBuf.getSize() > 0 ) | ||
64 | { | ||
65 | pSocket->write( sWriteBuf.getStr(), sWriteBuf.getSize() ); | ||
66 | sWriteBuf.clear(); | ||
67 | } | ||
68 | } | ||
69 | |||
61 | void Bu::Client::setProtocol( Protocol *pProto ) | 70 | void 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 | ||
90 | Bu::FString &Bu::Client::getOutput() | ||
91 | { | ||
92 | return sWriteBuf; | ||
93 | } | ||
94 | |||
95 | bool Bu::Client::isOpen() | ||
96 | { | ||
97 | if( !pSocket ) return false; | ||
98 | return pSocket->isOpen(); | ||
99 | } | ||
100 | |||
101 | void Bu::Client::write( const char *pData, int nBytes ) | ||
102 | { | ||
103 | sWriteBuf.append( pData, nBytes ); | ||
104 | } | ||
105 | |||