diff options
Diffstat (limited to 'src/client.h')
| -rw-r--r-- | src/client.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/client.h b/src/client.h index aecb16c..5a933ca 100644 --- a/src/client.h +++ b/src/client.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <stdint.h> | 11 | #include <stdint.h> |
| 12 | 12 | ||
| 13 | #include "bu/fstring.h" | 13 | #include "bu/fstring.h" |
| 14 | #include "bu/queuebuf.h" | ||
| 14 | 15 | ||
| 15 | namespace Bu | 16 | namespace Bu |
| 16 | { | 17 | { |
| @@ -31,8 +32,8 @@ namespace Bu | |||
| 31 | void processInput(); | 32 | void processInput(); |
| 32 | void processOutput(); | 33 | void processOutput(); |
| 33 | 34 | ||
| 34 | Bu::FString &getInput(); | 35 | //Bu::FString &getInput(); |
| 35 | Bu::FString &getOutput(); | 36 | //Bu::FString &getOutput(); |
| 36 | void write( const Bu::FString &sData ); | 37 | void write( const Bu::FString &sData ); |
| 37 | void write( const void *pData, int nBytes ); | 38 | void write( const void *pData, int nBytes ); |
| 38 | void write( int8_t nData ); | 39 | void write( int8_t nData ); |
| @@ -47,6 +48,7 @@ namespace Bu | |||
| 47 | int peek( void *pData, int nBytes, int nOffset=0 ); | 48 | int peek( void *pData, int nBytes, int nOffset=0 ); |
| 48 | void seek( int nBytes ); | 49 | void seek( int nBytes ); |
| 49 | long getInputSize(); | 50 | long getInputSize(); |
| 51 | long getOutputSize(); | ||
| 50 | 52 | ||
| 51 | void setProtocol( Protocol *pProto ); | 53 | void setProtocol( Protocol *pProto ); |
| 52 | Bu::Protocol *getProtocol(); | 54 | Bu::Protocol *getProtocol(); |
| @@ -65,7 +67,8 @@ namespace Bu | |||
| 65 | 67 | ||
| 66 | void onMessage( const Bu::FString &sMsg ); | 68 | void onMessage( const Bu::FString &sMsg ); |
| 67 | 69 | ||
| 68 | bool hasOutput() { return !sWriteBuf.isEmpty(); } | 70 | bool hasOutput() { return qbWrite.getSize() > 0; } |
| 71 | bool hasInput() { return qbRead.getSize() > 0; } | ||
| 69 | 72 | ||
| 70 | template<typename filter> | 73 | template<typename filter> |
| 71 | void pushFilter() | 74 | void pushFilter() |
| @@ -97,9 +100,8 @@ namespace Bu | |||
| 97 | Bu::Stream *pTopStream; | 100 | Bu::Stream *pTopStream; |
| 98 | Bu::Socket *pSocket; | 101 | Bu::Socket *pSocket; |
| 99 | Bu::Protocol *pProto; | 102 | Bu::Protocol *pProto; |
| 100 | Bu::FString sReadBuf; | 103 | Bu::QueueBuf qbRead; |
| 101 | int nRBOffset; | 104 | Bu::QueueBuf qbWrite; |
| 102 | Bu::FString sWriteBuf; | ||
| 103 | bool bWantsDisconnect; | 105 | bool bWantsDisconnect; |
| 104 | class Bu::ClientLinkFactory *pfLink; | 106 | class Bu::ClientLinkFactory *pfLink; |
| 105 | }; | 107 | }; |
