summaryrefslogtreecommitdiffstats
path: root/src/Stream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Stream.cpp')
-rw-r--r--src/Stream.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Stream.cpp b/src/Stream.cpp
index efe37d2..5c99724 100644
--- a/src/Stream.cpp
+++ b/src/Stream.cpp
@@ -360,9 +360,14 @@ void StreamSocket::ReadData(unsigned char *buffPtr, size_t buffLen) {
}
void StreamSocket::WriteData(unsigned char *buffPtr, size_t buffLen) {
- socket->Write(buffPtr, buffLen);
+ std::copy(buffPtr, buffPtr + buffLen, std::back_inserter(buffer));
}
StreamSocket::StreamSocket(Socket *socketPtr) : socket(socketPtr) {
-} \ No newline at end of file
+}
+
+void StreamSocket::Flush() {
+ socket->Write(buffer.data(), buffer.size());
+ buffer.clear();
+}