From 8bb5ccefc7aa857ce1d429bdc91e718e0c9baff0 Mon Sep 17 00:00:00 2001 From: Sandro Kalatozishvili Date: Tue, 26 Nov 2024 14:26:15 +0400 Subject: [PATCH] Updated async client example --- examples/async-client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/async-client.c b/examples/async-client.c index 5eec8f7..fe59639 100644 --- a/examples/async-client.c +++ b/examples/async-client.c @@ -65,7 +65,10 @@ int handle_write(xapi_ctx_t *pCtx, xapi_data_t *pData) int send_complete(xapi_ctx_t *pCtx, xapi_data_t *pData) { xlogn("Request sent: fd(%d)", (int)pData->sock.nFD); - XAPI_DisableEvent(pData, XPOLLOUT); + + xbyte_buffer_t *pBuffer = XAPI_GetTxBuff(pData); + if (!pBuffer->nUsed) XAPI_DisableEvent(pData, XPOLLOUT); + return XAPI_EnableEvent(pData, XPOLLIN); }