TCPServer: make write buffers global

Reduced memory usage per connection.
This commit is contained in:
SChernykh
2021-10-31 15:25:59 +01:00
parent 998c2ba72f
commit dff2413cae
2 changed files with 39 additions and 37 deletions

View File

@@ -89,21 +89,21 @@ public:
char m_readBuf[READ_BUF_SIZE];
uint32_t m_numRead;
struct WriteBuf
{
Client* m_client;
uv_write_t m_write;
char m_data[WRITE_BUF_SIZE];
};
uv_mutex_t m_writeBuffersLock;
std::vector<WriteBuf*> m_writeBuffers;
std::atomic<uint32_t> m_resetCounter{ 0 };
uv_mutex_t m_sendLock;
};
struct WriteBuf
{
Client* m_client;
uv_write_t m_write;
char m_data[WRITE_BUF_SIZE];
};
uv_mutex_t m_writeBuffersLock;
std::vector<WriteBuf*> m_writeBuffers;
struct SendCallbackBase
{
virtual ~SendCallbackBase() {}