diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2020-07-31 07:05:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-31 07:05:46 +0200 |
commit | 28caa598e29b7eaa36d0877dd57947d29fe92e06 (patch) | |
tree | 14ce54f1349966ce3482d270c1b104bdac6cc86d /src/Stream.cpp | |
parent | Merge pull request #42 from LaG1924/ftr/chat_component_parse (diff) | |
parent | Corrected Game Start conditions (diff) | |
download | AltCraft-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.cpp | 9 |
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(); +} |