summaryrefslogtreecommitdiffstats
path: root/src/Stream.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2020-07-31 07:05:46 +0200
committerGitHub <noreply@github.com>2020-07-31 07:05:46 +0200
commit28caa598e29b7eaa36d0877dd57947d29fe92e06 (patch)
tree14ce54f1349966ce3482d270c1b104bdac6cc86d /src/Stream.cpp
parentMerge pull request #42 from LaG1924/ftr/chat_component_parse (diff)
parentCorrected Game Start conditions (diff)
downloadAltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.gz
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.bz2
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.lz
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.xz
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.zst
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.zip
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();
+}