Core/Socket: Removed unused synchronous read method

(cherry picked from commit 59e9bcf0bf44d89397f5a182e2ef21f7e3a3635d)

Conflicts:
	src/server/game/Server/WorldSocket.cpp
This commit is contained in:
Shauren authored and DDuarte committed 2015-04-29 00:06:19 +01:00
1 parent 8b07f1cd4d
commit 88af3ffc2a
2 files changed
+4 -21

No files matched your search

+1 -20
View File
@@ -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));