(server) attempt at fixing #131 by using blocking writes in server mode
This commit is contained in:
@ -61,7 +61,8 @@ namespace ix
|
||||
enum class PollResult
|
||||
{
|
||||
Succeeded,
|
||||
AbnormalClose
|
||||
AbnormalClose,
|
||||
CannotFlushSendBuffer
|
||||
};
|
||||
|
||||
using OnMessageCallback =
|
||||
@ -135,6 +136,10 @@ namespace ix
|
||||
// client should mask but server should not
|
||||
std::atomic<bool> _useMask;
|
||||
|
||||
// Tells whether we should flush the send buffer before
|
||||
// saying that a send is complete. This is the mode for server code.
|
||||
std::atomic<bool> _blockingSend;
|
||||
|
||||
// Buffer for reading from our socket. That buffer is never resized.
|
||||
std::vector<uint8_t> _readbuf;
|
||||
|
||||
@ -238,6 +243,7 @@ namespace ix
|
||||
size_t closeWireSize,
|
||||
bool remote);
|
||||
|
||||
bool flushSendBuffer();
|
||||
void sendOnSocket();
|
||||
WebSocketSendInfo sendData(wsheader_type::opcode_type type,
|
||||
const std::string& message,
|
||||
|
Reference in New Issue
Block a user