work in progress to replace epoll with qse_mux_t

This commit is contained in:
2018-06-28 09:43:34 +00:00
parent 40cdf684de
commit 20e042df0c
4 changed files with 163 additions and 54 deletions

View File

@ -41,11 +41,13 @@ static int test1 (void)
([&server](QSE::Socket* clisock, QSE::SocketAddress* cliaddr) {
qse_char_t buf[128];
qse_uint8_t bb[256];
qse_ssize_t n;
while (!server.isStopRequested())
{
qse_printf (QSE_T("hello word..from %s\n"), cliaddr->toStrBuf(buf, QSE_COUNTOF(buf)));
if (clisock->receive(bb, QSE_COUNTOF(bb)) <= 0) break;
if ((n = clisock->receive(bb, QSE_COUNTOF(bb))) <= 0) break;
clisock->send (bb, n);
}
qse_printf (QSE_T("bye..to %s\n"), cliaddr->toStrBuf(buf, QSE_COUNTOF(buf)));
return 0;