mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Socket: Removed unused synchronous read method
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user