aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Networking
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/shared/Networking')
-rw-r--r--src/server/shared/Networking/Socket.h21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/server/shared/Networking/Socket.h b/src/server/shared/Networking/Socket.h
index 0ac23a96224..d337e07ff52 100644
--- a/src/server/shared/Networking/Socket.h
+++ b/src/server/shared/Networking/Socket.h
@@ -50,6 +50,7 @@ public:
virtual ~Socket()
{
+ _closed = true;
boost::system::error_code error;
_socket.close(error);
}
@@ -97,26 +98,6 @@ public:
std::bind(&Socket<T>::ReadHandlerInternal, this->shared_from_this(), std::placeholders::_1, std::placeholders::_2));
}
- void ReadData(std::size_t size)
- {
- if (!IsOpen())
- return;
-
- boost::system::error_code error;
-
- std::size_t bytesRead = boost::asio::read(_socket, boost::asio::buffer(_readBuffer.GetWritePointer(), size), error);
-
- _readBuffer.WriteCompleted(bytesRead);
-
- if (error || bytesRead != size)
- {
- TC_LOG_DEBUG("network", "Socket::ReadData: %s errored with: %i (%s)", GetRemoteIpAddress().to_string().c_str(), error.value(),
- error.message().c_str());
-
- CloseSocket();
- }
- }
-
void QueuePacket(MessageBuffer&& buffer, std::unique_lock<std::mutex>& guard)
{
_writeQueue.push(std::move(buffer));