send can fail silently when sending would block (EWOULDBLOCK return for send) (#18)

* try to use a pipe for communication

* flush send buffer on the background thread

* cleanup

* linux fix / linux still use event fd for now

* cleanup
This commit is contained in:
Benjamin Sergeant
2019-03-13 23:09:45 -07:00
committed by GitHub
parent dedbeb3eab
commit 08c2cdbf1d
19 changed files with 277 additions and 115 deletions

View File

@ -66,7 +66,13 @@ TEST_CASE("socket", "[socket]")
std::shared_ptr<Socket> socket(new Socket);
std::string host("www.google.com");
int port = 80;
std::string request("GET / HTTP/1.1\r\n\r\n");
std::stringstream ss;
ss << "GET / HTTP/1.1\r\n";
ss << "Host: " << host << "\r\n";
ss << "\r\n";
std::string request(ss.str());
int expectedStatus = 200;
int timeoutSecs = 3;

View File

@ -164,10 +164,21 @@ namespace
ss << "cmd_websocket_chat: Error ! " << error.reason;
log(ss.str());
}
else if (messageType == ix::WebSocket_MessageType_Ping)
{
log("cmd_websocket_chat: received ping message");
}
else if (messageType == ix::WebSocket_MessageType_Pong)
{
log("cmd_websocket_chat: received pong message");
}
else if (messageType == ix::WebSocket_MessageType_Fragment)
{
log("cmd_websocket_chat: received message fragment");
}
else
{
// FIXME: missing ping/pong messages
ss << "Invalid ix::WebSocketMessageType";
ss << "Unexpected ix::WebSocketMessageType";
log(ss.str());
}
});

View File

@ -77,6 +77,8 @@ shutil.copy(os.path.join(
'bin',
'zlib.dll'), '.')
testCommand = '{} {}'.format(testBinary, os.getenv('TEST', ''))
lldb = "lldb --batch -o 'run' -k 'thread backtrace all' -k 'quit 1'"
lldb = "" # Disabled for now
testCommand = '{} {} {}'.format(lldb, testBinary, os.getenv('TEST', ''))
ret = os.system(testCommand)
assert ret == 0, 'Test command failed'