From 33012c4ef4d39efad4fbc2b19f494f5c860fff51 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 18 Jun 2007 22:44:45 +0000 Subject: 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. --- src/client.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/client.cpp') 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() } } +void Bu::Client::processOutput() +{ + if( sWriteBuf.getSize() > 0 ) + { + pSocket->write( sWriteBuf.getStr(), sWriteBuf.getSize() ); + sWriteBuf.clear(); + } +} + void Bu::Client::setProtocol( Protocol *pProto ) { this->pProto = pProto; @@ -78,3 +87,19 @@ Bu::FString &Bu::Client::getInput() return sReadBuf; } +Bu::FString &Bu::Client::getOutput() +{ + return sWriteBuf; +} + +bool Bu::Client::isOpen() +{ + if( !pSocket ) return false; + return pSocket->isOpen(); +} + +void Bu::Client::write( const char *pData, int nBytes ) +{ + sWriteBuf.append( pData, nBytes ); +} + -- cgit v1.2.3