testing buffer improvements from mazgch
Fork of M2XStreamClient by
Diff: Client.h
- Revision:
- 12:0c9041dd96a6
- Parent:
- 0:f479e4f4db0e
--- a/Client.h Mon Sep 15 14:01:40 2014 +0000 +++ b/Client.h Wed Sep 24 16:46:43 2014 +0000 @@ -1,11 +1,11 @@ #ifndef Client_h #define Client_h - + #include "TCPSocketConnection.h" - + #include "Print.h" #include "Utility.h" - + /* * TCP Client */ @@ -13,7 +13,7 @@ public: Client(); ~Client(); - + virtual int connect(const char *host, uint16_t port); virtual size_t write(uint8_t); virtual size_t write(const uint8_t *buf, size_t size); @@ -24,9 +24,14 @@ virtual uint8_t connected(); private: virtual int read(uint8_t *buf, size_t size); - uint8_t _buf[1]; - uint8_t _len; + void _fillin(void); + uint8_t _inbuf[128]; + uint8_t _incnt; + void _flushout(void); + uint8_t _outbuf[128]; + uint8_t _outcnt; TCPSocketConnection _sock; }; - + #endif + \ No newline at end of file